mardi 28 juillet 2015

I Ember, is it possible to access the app directly in an acceptance test?

I have a mixin that handles showing messages to users at various parts of the app, and hooks in the routes can remove or show them, etc.

I'm having trouble testing this mixin directly and in an isolated, because I need a full functioning app, with transistions etc.

I can test it in a "normal" acceptance test, in a specific use case, but that would technically be for a separate workflow that makes use of this mixin.

I'd like to load the app in an acceptance test, and then call some methods on certain controllers (application controller in this case), if possible.

I do have access to an application instance via:

var application;

module('Acceptance: ApplicationMessaging', {
  beforeEach: function() {
    application = startApp();
  },

  afterEach: function() {
    Ember.run(application, 'destroy');
  }
});




Aucun commentaire:

Enregistrer un commentaire