Skip to content

Commit cf3b65a

Browse files
committed
wip
1 parent 762a1b5 commit cf3b65a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/__tests__/plugin-test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,25 @@ describe('mongoose-dp', () => {
3636
expect(diffs[0].c).toMatchSnapshot();
3737
expect(diffs[0].v).toBe(1);
3838
});
39+
40+
// it('save array diffs properly', async () => {
41+
// await Post.create({ title: 'arrayCheck', subjects: [{ name: 'was' }] });
42+
// const post: PostDoc = (await Post.findOne({ title: 'arrayCheck' }).exec(): any);
43+
// post.subjects = [{ name: 'was' }, { name: 'first' }];
44+
// await post.save();
45+
46+
// const post1: PostDoc = (await Post.findOne({ title: 'arrayCheck' }).exec(): any);
47+
// post1.subjects = [{ name: 'was' }, { name: 'first' }, { name: 'second' }];
48+
// await post1.save();
49+
50+
// const post2: PostDoc = (await Post.findOne({ title: 'arrayCheck' }).exec(): any);
51+
// post2.subjects = [{ name: 'first' }, { name: 'second' }];
52+
// await post2.save();
53+
54+
// const Diff = Post.diffModel();
55+
// const diffs = await Diff.findByDocId(post2._id);
56+
// expect(diffs).toMatchInli
57+
// const merged = await Diff.mergeDiffs(post2);
58+
// expect(merged).toBe();
59+
// });
3960
});

0 commit comments

Comments
 (0)