mardi 20 octobre 2015

Ember Integration Test Doesn't See the DOM

import Ember from 'ember';
import startApp from '../../helpers/start-app';

var App;

module('Integration | Authentication | Abilities', {
  integration: true,
  setup() {
    App = startApp();
  },
  teardown() {
    Ember.run(App, 'destroy');
  }
});

test('Only SuperUsers, Researchers and AccountHolders can see messages', function(assert) {
  visit('/');
  assert.equal(find('div').text(), 'fsfsfd');
});

This is an integration test I'm trying to get working so I can test basic user interaction in our ember-cli app. The problem is that this simple test does only returns empty strings whenever I search the DOM. It is not hitting an unauthorized page or anything it's just returning nothing from any testHelpers. currentURL, currentPath return undefined.

Am I missing something absolutely fundamental in my understanding of how integration tests work?

I'm trying to test how ember-can gives and denies permissions to users based on their title. However, I may as well just be testing whether or not the logo shows up in the right corner because I can't see anything on the page at the moment.




Aucun commentaire:

Enregistrer un commentaire