Skip to content

Commit

Permalink
test(subdocument): repro #8223
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Oct 11, 2019
1 parent 89eb449 commit 54db026
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/types.subdocument.test.js
Expand Up @@ -92,4 +92,16 @@ describe('types.subdocument', function() {
}, {$set: thingy2});
});
});

describe('#isModified', function() {
it('defers to parent isModified (gh-8223)', function() {
const childSchema = Schema({ id: Number, text: String });
const parentSchema = Schema({ child: childSchema });
const Model = db.model('gh8223', parentSchema);

const doc = new Model({ child: { text: 'foo' } });
assert.ok(doc.isModified('child.id'));
assert.ok(doc.child.isModified('id'));
});
});
});

0 comments on commit 54db026

Please sign in to comment.