Skip to content

Commit

Permalink
style(json-crdt): 💄 run Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Apr 28, 2024
1 parent 407c383 commit cc7ba8d
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/json-crdt/model/__tests__/Model.setSchema.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ test('can set map schema', () => {
});

test('uses global session ID by default', () => {
const model = Model.withLogicalClock().setSchema(s.obj({
id: s.str<string>('asdf'),
num: s.con(123),
}));
const model = Model.withLogicalClock().setSchema(
s.obj({
id: s.str<string>('asdf'),
num: s.con(123),
}),
);
expect(model.api.r.get().node.id.sid).toBe(SESSION.GLOBAL);
expect(model.api.r.get().get('id').node.id.sid).toBe(SESSION.GLOBAL);
expect(model.api.r.get().get('num').node.id.sid).toBe(SESSION.GLOBAL);
Expand All @@ -49,10 +51,12 @@ test('allows to specify custom session ID', () => {
});

test('resets session ID to user specified', () => {
const model = Model.withLogicalClock().setSchema(s.obj({
id: s.str<string>('asdf'),
num: s.con(123),
}));
const model = Model.withLogicalClock().setSchema(
s.obj({
id: s.str<string>('asdf'),
num: s.con(123),
}),
);
expect(model.view().num).toBe(123);
expect(model.api.r.get().get('num').node.id.sid).toBe(SESSION.GLOBAL);
model.api.r.get().set({
Expand Down

0 comments on commit cc7ba8d

Please sign in to comment.