Skip to content

Commit

Permalink
instanceof test
Browse files Browse the repository at this point in the history
  • Loading branch information
luxzeitlos committed Feb 11, 2022
1 parent 1164271 commit d4b934e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/unit/changeset-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2754,4 +2754,13 @@ module('Unit | Utility | changeset', function (hooks) {
changeset.unexecute();
assert.ok(true); // we just want no error until here
});

test('instanceof checks on custom classes work`', async function (assert) {
class Foo {}
let model = EmberObject.create({ foo: new Foo() });
let dummyChangeset = Changeset(model);

assert.ok(dummyChangeset.foo.content instanceof Foo, 'content property is an instance');
assert.ok(dummyChangeset.foo instanceof Foo, 'proxy itself is an instance');
});
});

0 comments on commit d4b934e

Please sign in to comment.