@roc-db/test-utils 0.2.0-pre.67 → 0.2.0-pre.68
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.
- package/dist/index.js +8 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -498,13 +498,16 @@ var readPostBySlug = readOperation9("readPostBySlug", z34.string(), (txn) => {
|
|
|
498
498
|
import { expect } from "bun:test";
|
|
499
499
|
import { Query as Query22, QueryChain as QueryChain9, writeOperation as writeOperation13 } from "roc-db";
|
|
500
500
|
import { z as z35 } from "zod";
|
|
501
|
-
var TestCreatePatchDeleteInSameTransaction = (txn,
|
|
501
|
+
var TestCreatePatchDeleteInSameTransaction = (txn, title) => {
|
|
502
502
|
const postRef = txn.createRef("Post");
|
|
503
|
-
QueryChain9(Query22(() => txn.createEntity(postRef, {
|
|
504
|
-
|
|
503
|
+
return QueryChain9(Query22(() => txn.createEntity(postRef, {
|
|
504
|
+
data: { title, tags: [] },
|
|
505
|
+
children: { blocks: [] }
|
|
506
|
+
})), Query22(() => txn.patchEntity(postRef, { data: { foo: "bar" } })), Query22((post) => {
|
|
507
|
+
expect(post.data.title).toBe(title);
|
|
505
508
|
expect(post.data.foo).toBe("bar");
|
|
506
509
|
}), Query22(() => txn.patchEntity(postRef, { data: { foo: null, bar: "foo" } })), Query22((post) => {
|
|
507
|
-
expect(post.data.
|
|
510
|
+
expect(post.data.title).toBe(title);
|
|
508
511
|
expect(post.data.foo).toBeUndefined();
|
|
509
512
|
expect(post.data.bar).toBe("foo");
|
|
510
513
|
expect(txn.log).toHaveLength(1);
|
|
@@ -685,7 +688,7 @@ var prepareChangeSetTest = async (adapter, adapter2) => {
|
|
|
685
688
|
});
|
|
686
689
|
expect2(updatedPost.children.blocks).toStrictEqual([blockParagraph1.ref]);
|
|
687
690
|
expect2(updatedPost.children.blocks).toHaveLength(1);
|
|
688
|
-
expect2(createBlockParagraphMutation.log[
|
|
691
|
+
expect2(createBlockParagraphMutation.log[1][2].children.blocks).toStrictEqual([]);
|
|
689
692
|
const readPost1 = await changeSetAdapter.readEntity(post.ref);
|
|
690
693
|
expect2(readPost1.children.blocks).toHaveLength(1);
|
|
691
694
|
const [{ block: blockRow, updatedParent: updatedPost2 }, mutation] = await changeSetAdapter.createBlockRow({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roc-db/test-utils",
|
|
3
|
-
"version": "0.2.0-pre.
|
|
3
|
+
"version": "0.2.0-pre.68",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"sideEffects": false,
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"roc-db": "0.2.0-pre.
|
|
20
|
+
"roc-db": "0.2.0-pre.68",
|
|
21
21
|
"zod": "3.24.2"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [],
|