Skip to content

Commit 346e8a2

Browse files
committed
fix tests expecting clientIds
1 parent 3db5d53 commit 346e8a2

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

src/component/lib.test.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,12 @@ describe("prosemirror lib", () => {
9696
test("get handles missing snapshot", async () => {
9797
const t = convexTest(schema, modules);
9898
const id = crypto.randomUUID();
99-
const { content, steps, clientIds, version } = await t.query(api.lib.get, {
99+
const { content, steps, version } = await t.query(api.lib.get, {
100100
id,
101101
version: 2,
102102
});
103103
expect(content).toEqual(null);
104104
expect(steps).toEqual(undefined);
105-
expect(clientIds).toEqual(undefined);
106105
expect(version).toEqual(undefined);
107106
const ignoringSteps = await t.query(api.lib.get, {
108107
id,
@@ -111,7 +110,6 @@ describe("prosemirror lib", () => {
111110
});
112111
expect(ignoringSteps.content).toEqual(null);
113112
expect(ignoringSteps.steps).toEqual(undefined);
114-
expect(ignoringSteps.clientIds).toEqual(undefined);
115113
expect(ignoringSteps.version).toEqual(undefined);
116114
});
117115
test("get works with only snapshot", async () => {
@@ -124,13 +122,12 @@ describe("prosemirror lib", () => {
124122
content: "content",
125123
});
126124
});
127-
const { content, steps, clientIds, version } = await t.query(api.lib.get, {
125+
const { content, steps, version } = await t.query(api.lib.get, {
128126
id,
129127
version: 0,
130128
});
131129
expect(content).toEqual("content");
132130
expect(steps).toEqual([]);
133-
expect(clientIds).toEqual([]);
134131
expect(version).toEqual(0);
135132
});
136133
test("get ignores steps when asked", async () => {
@@ -150,14 +147,13 @@ describe("prosemirror lib", () => {
150147
steps: ["1", "2"],
151148
});
152149
});
153-
const { content, steps, clientIds, version } = await t.query(api.lib.get, {
150+
const { content, steps, version } = await t.query(api.lib.get, {
154151
id,
155152
version: 2,
156153
ignoreSteps: true,
157154
});
158155
expect(content).toEqual("content");
159156
expect(steps).toEqual([]);
160-
expect(clientIds).toEqual([]);
161157
expect(version).toEqual(0);
162158
});
163159
test("get skips steps before snapshot", async () => {
@@ -177,13 +173,12 @@ describe("prosemirror lib", () => {
177173
steps: ["1", "2"],
178174
});
179175
});
180-
const { content, steps, clientIds, version } = await t.query(api.lib.get, {
176+
const { content, steps, version } = await t.query(api.lib.get, {
181177
id,
182178
version: 2,
183179
});
184180
expect(content).toEqual("content");
185181
expect(steps).toEqual(["2"]);
186-
expect(clientIds).toEqual([clientId]);
187182
expect(version).toEqual(2);
188183
});
189184
test("get skips steps before snapshot & beyond version", async () => {
@@ -215,13 +210,12 @@ describe("prosemirror lib", () => {
215210
steps: ["3", "4"],
216211
});
217212
});
218-
const { content, steps, clientIds, version } = await t.query(api.lib.get, {
213+
const { content, steps, version } = await t.query(api.lib.get, {
219214
id,
220215
version: 3,
221216
});
222217
expect(content).toEqual("new content");
223218
expect(steps).toEqual(["2", "3"]);
224-
expect(clientIds).toEqual([clientId, clientId2]);
225219
expect(version).toEqual(3);
226220
});
227221
test("create, submit, then get works", async () => {
@@ -238,13 +232,12 @@ describe("prosemirror lib", () => {
238232
version: 0,
239233
steps: ["a", "b"],
240234
});
241-
const { content, steps, clientIds, version } = await t.query(api.lib.get, {
235+
const { content, steps, version } = await t.query(api.lib.get, {
242236
id,
243237
version: 2,
244238
});
245239
expect(content).toEqual("content");
246240
expect(steps).toEqual(["a", "b"]);
247-
expect(clientIds).toEqual(["client1", "client1"]);
248241
expect(version).toEqual(2);
249242
});
250243
test("submitSnapshot same content is idempotent", async () => {

0 commit comments

Comments
 (0)