jeudi 3 mars 2016

Integrating Ember_simple_auth with acceptance tests (using Mirage)

I created a basic test app that uses the OMDb API (The Open Movie Database), and with some help from SO posters everything is working fine.

I added ember-simple-auth (version 1.0.0) to the project, and got the dev side of things going. Basically there's a simple login screen to get into the main app. It's working as expected.

However, my two basic acceptance tests are now not working. After adding the ember-simple-auth components and functionality to the app, to the acceptance test file I added:

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

and in a test itself, I added:

authenticateSession();

The test now fails, saying:

Cannot read property '__container__' of undefined

Moreover, if I comment out the import line and the authenticateSession() call, the test still fails, but because the DOM is apparently completely empty.

The whole thing is available in a repo if anyone is curious/willing: git@github.com:bdrsgg/ember-movie-example.git (branch = feature/ember-simple-auth)

I assume there's some configuration issue I'm getting wrong, or something like that. Appreciate any help anyone can offer.




Aucun commentaire:

Enregistrer un commentaire