Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4829

afterEach: signOut is not a function

$
0
0

@kgish wrote:

For my acceptance tests I have created a very simple async test helper for logging out the user if logged in:

// tests/helpers/sign-out.js
import Ember from 'ember';

export default Ember.Test.registerHelper('signOut', function(/*app*/) {
    if (find('#navigation-logout').length === 1) {
        click('#navigation-logout');
    }
});

I would like it to be called in the afterEach hook like this:

moduleForAcceptance('Acceptance | Admin | ...', {
    beforeEach: function() {
        signinAdmin();
    },
    afterEach: function() {
        signOut();
    }
});

However my test fails with the following error message:

afterEach failed on Admin can access the profile page from dashboard: signOut is not a function

Putting it in the beforeEach hook works fine, and moving signinAdmin() to the afterEach hook gives the same problem.

Any ideas what I'm doing wrong and how to fix?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4829

Trending Articles