So I am trying to write an acceptance test for my ember app. I use Ember Simple Auth and in the route I have the following code
let session = getOwner(this).lookup('session:main'),
sessionStore = this.get('session.store');
sessionStore.updateKey("my-app");
When I am running the app it works just fine. Now when I write the following test I get errors that updateKey
is not a function
import { module, test } from 'qunit';
import { visit, currentURL } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import { currentSession } from 'ember-simple-auth/test-support';
module('Acceptance | service menu', function(hooks) {
setupApplicationTest(hooks);
setupMirage(hooks);
test('visiting /service-menu', async function(assert) {
this.server.createList('service-category', 5);
this.server.create('location');
currentSession(this.application);
await visit('/location/testLocation/service-menu');
await this.pauseTest();
assert.equal(currentURL(), '/location/testLocation/service-menu');
});
});
What am I missing? I do not want the user to be logged in.