From f233afec68bbf5d8bcacd211f983160453036a96 Mon Sep 17 00:00:00 2001 From: Gaurav Munjal Date: Tue, 5 Nov 2019 15:17:03 -0500 Subject: [PATCH] last tests --- .../tests/integration/reload-test.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/unpublished-adapter-encapsulation-test-app/tests/integration/reload-test.js b/packages/unpublished-adapter-encapsulation-test-app/tests/integration/reload-test.js index 212a16aefe3..8464acc6bbe 100644 --- a/packages/unpublished-adapter-encapsulation-test-app/tests/integration/reload-test.js +++ b/packages/unpublished-adapter-encapsulation-test-app/tests/integration/reload-test.js @@ -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() {});