Skip to content

Commit 9aa33f1

Browse files
committed
fix(json-crdt-patch): 🐛 make all tests pass
1 parent 8ab4e2c commit 9aa33f1

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/json-crdt-patch/PatchBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ export class PatchBuilder {
351351
* Run builder commands to create a JSON value.
352352
*/
353353
public jsonVal(value: unknown): ITimestampStruct {
354-
const id = this.const(value);
355354
const valId = this.val();
355+
const id = this.const(value);
356356
this.setVal(valId, id);
357357
return valId;
358358
}

src/json-crdt-patch/codec/verbose/__tests__/bug-1.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const encoded1 = {
99
},
1010
{
1111
op: 'new_val',
12-
value: 1,
1312
},
1413
{
1514
op: 'new_bin',
@@ -22,7 +21,6 @@ const encoded1 = {
2221
},
2322
{
2423
op: 'new_val',
25-
value: 2,
2624
},
2725
{
2826
op: 'ins_obj',

src/json-crdt/model/__tests__/Model.server-clock.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('server clock', () => {
77
const model = Model.withServerClock();
88
expect(model.clock.time).toBe(1);
99
model.api.root(true);
10-
expect(model.clock.time).toBe(4);
10+
expect(model.clock.time).toBe(5);
1111
model.api.root({foo: 'bar'});
1212
model.applyPatch(model.api.builder.patch);
1313
model.applyPatch(model.api.builder.patch);
@@ -18,7 +18,7 @@ describe('server clock', () => {
1818
const model = Model.withServerClock();
1919
expect(model.clock.time).toBe(1);
2020
model.api.root(true);
21-
expect(model.clock.time).toBe(4);
21+
expect(model.clock.time).toBe(5);
2222
const clock = model.clock.clone();
2323
clock.tick(1);
2424
const builder = new PatchBuilder(clock);

0 commit comments

Comments
 (0)