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

[CHORE] refactor: Remove runloop usage in integration tests for store/ find All module #6712

Merged
Changes from 1 commit
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
12 changes: 4 additions & 8 deletions packages/-ember-data/tests/integration/store-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ module('integration/store - findAll', function(hooks) {
});

test('store#findAll should eventually return all known records even if they are not in the adapter response', async function(assert) {
assert.expect(5);
assert.expect(4);

this.owner.register('model:car', Car);
this.owner.register('adapter:application', RESTAdapter.extend());
Expand Down Expand Up @@ -913,19 +913,15 @@ module('integration/store - findAll', function(hooks) {

assert.equal(cars.length, 2, 'It returns all cars');

let carsInStore = store.peekAll('car');
await settled();
runspired marked this conversation as resolved.
Show resolved Hide resolved

assert.equal(carsInStore.length, 2, 'There is 2 cars in the store');
let carsInStore = store.peekAll('car');

cars = store.peekAll('car');
assert.equal(carsInStore.length, 2, 'There is 2 cars in the store after all promises has been resolved');

let mini = cars.findBy('id', '1');

assert.equal(mini.model, 'New Mini', 'Existing records have been updated');

carsInStore = store.peekAll('car');

assert.equal(carsInStore.length, 2, 'There is 2 cars in the store');
});

test('Using store#fetch on an empty record calls find', async function(assert) {
Expand Down