ember-simple-auth: TypeError: Cannot read property 'container' of undefined

Hi, So I’m trying to test my ember application. But I have some pages which require authentification. I used ember-simple-auth with firebase, so for the test , I followed the ember-simple-auth documentation.

config:

if (environment === 'test') {
		ENV['simple-auth'] = {
			store: 'simple-auth-session-store:ephemeral'
		};

my test :

...
import {
	currentSession,
	authenticateSession,
	invalidateSession
} from 'tpjsv2login/tests/helpers/ember-simple-auth';
....

test('should access /vehicule if authenticate', function (assert) {
	authenticateSession();
	visit('/vehicule');

	andThen(function () {
		assert.equal(currentURL(), '/vehicule');
	});

});

And I have the following issue in my test : TypeError: Cannot read property '__container__' of undefined Thanks for your help ! Xavier

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 21 (8 by maintainers)

Most upvoted comments

You need to pass the application instance to the authenticateSession helper method (and all other helper methods that ESA provides):

authenticateSession(this.application);