Skip to content

Commit

Permalink
last tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaurav0 committed Nov 5, 2019
1 parent e22f63d commit f233afe
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,30 @@ module('integration/reload - Reloading Tests', function(hooks) {

assert.equal(this.adapter.requestsMade, 0, 'no ajax request is made');
});

test('adapter.shouldReloadAll is called when store.findAll is called without a reload flag (shouldReloadAll is false)', async function(assert) {
setupReloadTest.call(this, {
shouldReloadAll: false,
shouldBackgroundReloadAll: false,
});

await this.store.findAll('person');

assert.equal(this.adapter.shouldReloadAllCalled, 1, 'shouldReloadAll is called');
assert.equal(this.adapter.requestsMade, 0, 'no ajax request is made');
});

test('adapter.shouldReloadAll is called when store.findAll is called without a reload flag (shouldReloadAll is false)', async function(assert) {
setupReloadTest.call(this, {
shouldReloadAll: true,
shouldBackgroundReloadAll: false,
});

await this.store.findAll('person');

assert.equal(this.adapter.shouldReloadAllCalled, 1, 'shouldReloadAll is called');
assert.equal(this.adapter.requestsMade, 1, 'an ajax request is made');
});
});

module('adapter.shouldBackgroundReloadAll', function() {});
Expand Down

0 comments on commit f233afe

Please sign in to comment.