test: Init filter store test for sessions

This commit is contained in:
Susmitha Girumala committed 2021-11-01 15:01:12 -04:00
1 parent df7bd5671a
commit 8c4a076367
1 file changed
+8 -3
@@ -1,15 +1,17 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import { Response } from 'miragejs';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
module('Unit | Service | filterable-store', function (hooks) {
setupTest(hooks);
setupMirage(hooks);
let store;
hooks.beforeEach(function () {
store = this.owner.lookup('service:filterable-store');
store.createRecord('account', {
store.createRecord('session', {
id: 'i_1234567890',
scope: {
id: '123',
@@ -18,7 +20,10 @@ module('Unit | Service | filterable-store', function (hooks) {
});
test('it supports query filtering', function (assert) {
tore.filterByIds('account', { scope_id: '123' });
this.server.get('/v1/sessions?scope_id=123', () => {
new Response({});
});
store.filterByIds('session', { scope_id: '123' });
assert.ok(store);
});