Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal: fix test settledness #8960

Merged
merged 2 commits into from
Oct 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/main/tests/integration/records/delete-record-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { setupTest } from 'ember-qunit';

import Adapter from '@ember-data/adapter';
import { InvalidError } from '@ember-data/adapter/error';
import { DEBUG } from '@ember-data/env';
import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
import JSONAPISerializer from '@ember-data/serializer/json-api';
import { recordIdentifierFor } from '@ember-data/store';
Expand Down Expand Up @@ -494,11 +495,16 @@ module('integration/deletedRecord - Deleting Records', function (hooks) {

await company.destroyRecord();

// wait for ember's runloop to flush
await settled();

try {
assert.true(company.isDeleted, 'isDeleted should be true');
assert.true(company.isDestroying, 'isDestroying should be true');
assert.true(company.isDestroyed, 'isDestroyed should be true');
assert.strictEqual(company.id, undefined, 'id access should be safe');
if (DEBUG) {
assert.strictEqual(company.id, undefined, 'id access should be safe');
}
} catch (e) {
assert.ok(false, `Should not throw an error, threw ${e.message}`);
}
Expand Down
Loading