File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff 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} ) ;
You can’t perform that action at this time.
0 commit comments