@roc-db/test-utils 0.2.0-pre.100 → 0.2.0-pre.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +24 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1327,7 +1327,30 @@ var testAdapterImplementation = async (adapterConstructor, generateArgs) => {
1327
1327
  expect2(() => changeSetAdapter2.createBlockImage({
1328
1328
  parentRef: post2.ref,
1329
1329
  url: "https://example.com/image.png"
1330
- })).toThrowError("The provided changeSetRef has already been applied");
1330
+ })).toThrowError(new RegExp(`changeSetRef .*${draftRef2}.* has already been applied`));
1331
+ });
1332
+ test("debounce does not collapse across changeSets (applied draft)", async () => {
1333
+ const [post2] = await adapter1.createPost({
1334
+ title: "Debounce repro",
1335
+ slug: faker.lorem.slug(5),
1336
+ tags: []
1337
+ });
1338
+ const [draft1] = await adapter1.createDraft({ postRef: post2.ref });
1339
+ const draft1adapter = adapter1.changeSet(draft1.ref);
1340
+ const [, mutation1] = await draft1adapter.updatePostDescription({
1341
+ ref: post2.ref,
1342
+ description: "From draft 1"
1343
+ });
1344
+ expect2(mutation1.changeSetRef).toBe(draft1.ref);
1345
+ await adapter1.applyDraft(draft1.ref);
1346
+ const [draft2] = await adapter1.createDraft({ postRef: post2.ref });
1347
+ const draft2adapter = adapter1.changeSet(draft2.ref);
1348
+ const [, mutation2] = await draft2adapter.updatePostDescription({
1349
+ ref: post2.ref,
1350
+ description: "From draft 2"
1351
+ });
1352
+ expect2(mutation2.ref).not.toBe(mutation1.ref);
1353
+ expect2(mutation2.changeSetRef).toBe(draft2.ref);
1331
1354
  });
1332
1355
  test("deleteDraft", async () => {
1333
1356
  const { draftRef: draftRef2 } = await prepareChangeSetTest(adapter1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roc-db/test-utils",
3
- "version": "0.2.0-pre.100",
3
+ "version": "0.2.0-pre.101",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {