0

Having issues running Jasmine Test with Twitter Flight. I'm using the jasmine-flight Plugin.

Error(s)

Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
TypeError: this.Component is not a constructor
    at Object.setupComponent (/frontend/bower_components/jasmine-flight/lib/jasmine-flight.js:44:23)
    at Object.<anonymous> (/frontend/test/spec/component_ui/list-spec.js:5:10)
TypeError: Cannot read property 'trigger' of null
    at Object.<anonymous> (/frontend/test/spec/component_ui/list-spec.js:19:19)

Test Component

    describeComponent('javascript/component_ui/list-ui', function() {
      'use strict';
  beforeEach(function() {
    jasmine.getFixtures().fixturesPath = 'base/test/fixtures';
    this.setupComponent(
        readFixtures('list.html'),
        {
          listRightMenu: '.list-right',
          listSortSelector: '.list-sort',
        }
      );
  });

      it('Show menu when button is clicked', function() {

        console.log(this);

        this.component.trigger(this.component.attr.listSortSelector, 'click');
        expect(this.component.attr.listRightMenu).toBeVisible();
      });
    });
Jamie White
  • 1,560
  • 3
  • 22
  • 48
  • What is the content of `javascript/component_ui/list-ui` and the output of `console.log(this);`? – Rudi Apr 14 '16 at 06:36
  • list-ui is a the flight component that is to be tested. log outputs contents of list.html along with: `length: 9}, component: null, Component: null, setupComponent: function () { ... }}.` – Jamie White Apr 14 '16 at 11:43

0 Answers0