Saturday 15 February 2014

ember.js - EmberJS: Unit testing a Component says common helpers like 'click' and 'andThen' are undefined -


TLR

However, I'm trying to test a very simple component unit, It appears that some very common test assistants are not being defined. This is a specific component about the unit testing, because I am using it without any problems in the integration test.

Now errors are normal: click

  is not defined and is not defined again  

Stack trace for reference: Test on ObjectStat died on # 4 (http: // localhost: 7357 / property / test-support .js: 110: 11) http: // localhost: 7357 / property / Skylab.js: mod.state (http: // localhost: 7357 / assets / vendor.js: 150: 29) on the object testloader at tryFinally (http: // localhost: 7357 / assets / vendor.js : 30: 14) Requires modules (http: // localhost: 7357 / assets / vendor.js: 148: 5) but on. Object. Testloader Load modules (http: // localhost: 7357 / assets / test-loader .js: 29: 9) are required on (http: // localhost: 7357 / assets / test-loader .js: 21:18) Click is not defined

components and tests are very basic components:

import 'amber' from amber; Export Default Ember.TextField.extend ({classNames: ['input-span']});

Test:

Import 'amber' from amber; Import from 'Amber-Cunits' {moduleForComponent, test}; ModuleForComponent ('custom input'); Test ('focus on click', function (emphasis) {assert.expect (1); var component = this.subject (); this.render (); Click ('input') assert.ok (component. $ (': Input'). (': Focus'));});

looks best

My best estimate is that these authors work in acceptance testing because startapp assistant Click and and then the assistant function I do not have setup; The teardown code in my moduleForComponent call, but it does not look like I need it and I do not want to test the whole app here - just a separate component

Question

  1. Is there any other way to inject these test assistants?
  2. Am I writing this test incorrectly? Should I never click on component testing? Is this document outdated?
  3. Should it be supported in writing, and is it a frame bug that I should report?
  4. Assistance level assistants are currently dependent on an app, such as they Uni-level tests are not available because they do not have an app.


1 comment: