mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-14 16:42:09 +00:00
Merge pull request #17099 from overleaf/mj-no-op-transform
[overleaf-editor-core] Fix transform for no-op Operation GitOrigin-RevId: 20b8681153fb0788feb7d5d9954781a5432dbe69
This commit is contained in:
parent
1b93f97468
commit
826020effe
2 changed files with 7 additions and 1 deletions
|
@ -160,7 +160,7 @@ class Operation {
|
||||||
* @return {Operation[]} operations `[a', b']`
|
* @return {Operation[]} operations `[a', b']`
|
||||||
*/
|
*/
|
||||||
static transform(a, b) {
|
static transform(a, b) {
|
||||||
if (a.isNoOp() || b.isNoOp()) return [b, a]
|
if (a.isNoOp() || b.isNoOp()) return [a, b]
|
||||||
|
|
||||||
function transpose(transformer) {
|
function transpose(transformer) {
|
||||||
return transformer(b, a).reverse()
|
return transformer(b, a).reverse()
|
||||||
|
|
|
@ -741,4 +741,10 @@ describe('Operation', function () {
|
||||||
.expectFiles({})
|
.expectFiles({})
|
||||||
.expectSymmetry()
|
.expectSymmetry()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('transforms no-op with other operation', function () {
|
||||||
|
runConcurrently(Operation.NO_OP, addFile('foo', 'test')).expectFiles({
|
||||||
|
foo: 'test',
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue