Skip to content

Commit

Permalink
Update fake-model-test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
esbanarango committed Aug 1, 2023
1 parent 83f25cc commit dcb3150
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/unit/models/fake-model-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,18 +604,15 @@ module('Unit | Model | fake-model', function (hooks) {

module('Relations validations', function () {
module('`hasMany` relations', function () {
test('it validates the relations specified on `validations.relations`', function (assert) {
test('it validates the relations specified on `validations.relations`', async function (assert) {
assert.expect(1);
const store = this.owner.lookup('service:store');
const model = store.createRecord('fake-model', { email: '[email protected]', name: 'Jose Rene Higuita' });

let otherFakes = model.get('otherFakes');
let otherFakes = await model.otherFakes;
const otherFake = store.createRecord('other-model');
if (otherFakes.push) {
otherFakes.push(otherFake);
} else {
otherFakes.pushObject(otherFake);
}

otherFakes.push(otherFake);

assert.false(model.validate({ only: ['otherFakes'] }));
});
Expand Down

0 comments on commit dcb3150

Please sign in to comment.