Testing Twitter Flight Component with Jasmine

30 views
Skip to first unread message

appren...@googlemail.com

unread,
Apr 13, 2016, 2:32:30 PM4/13/16
to Twitter Flight
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 

    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();
      });
    });
Reply all
Reply to author
Forward
0 new messages