From a4b7d9f105d5911e500df7d0d7063b625ac6b522 Mon Sep 17 00:00:00 2001 From: Chris Thoburn Date: Fri, 6 Oct 2023 12:18:09 -0700 Subject: [PATCH 1/2] internal: fix test settledness --- tests/main/tests/integration/records/delete-record-test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/main/tests/integration/records/delete-record-test.js b/tests/main/tests/integration/records/delete-record-test.js index 5403fb8199e..b231443bfb8 100644 --- a/tests/main/tests/integration/records/delete-record-test.js +++ b/tests/main/tests/integration/records/delete-record-test.js @@ -494,6 +494,9 @@ 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'); From 5ea63b4d1ab1d5b9009c8bdb4063862f451d97e7 Mon Sep 17 00:00:00 2001 From: Chris Thoburn Date: Fri, 6 Oct 2023 14:40:53 -0700 Subject: [PATCH 2/2] fix prod --- tests/main/tests/integration/records/delete-record-test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/main/tests/integration/records/delete-record-test.js b/tests/main/tests/integration/records/delete-record-test.js index b231443bfb8..4ef3306ee42 100644 --- a/tests/main/tests/integration/records/delete-record-test.js +++ b/tests/main/tests/integration/records/delete-record-test.js @@ -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'; @@ -501,7 +502,9 @@ module('integration/deletedRecord - Deleting Records', function (hooks) { 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}`); }