question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Integration Test Helpers are undefined in Component Test

See original GitHub issue

I’m writing a tutorial about creating Ember Addons / Components. Since it is a datepicker component I want to test various user interactions on the component.

These tests fail because the helpers click etc. are not defined. I’m following the official Ember.js guide and it fails. I’m not sure if this is a problem on my end or something is broken?

Related SO question: http://stackoverflow.com/questions/25657787/acceptance-testing-a-ember-datepicker-component-with-ember-cli

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
abepetrillocommented, Apr 5, 2016

Just a note for noobs like me who end up here, adding this to the test imports the helpers for “integration” tests:

moduleForComponent('my-component', 'myComponent', {
  integration: true
});
4reactions
rstudnercommented, Nov 20, 2016

I’m having this problem right now in v2.9.1

I have: tests/helpers/assert-trimmed-text.js (and i’ve tried assertTrimmedText.js) tests/helpers/start-app.js with: import ‘./assert-trimmed-text’; (and tried import ‘./assertTrimmedText’; as above etc)

in ANY component test, if I do assertTrimmedText(stuff) I get told: http://localhost:7357/assets/test-support.js:6956:22: Can’t find variable: assertTrimmedText

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit testing a Component says common helpers like 'click' and ...
I'm trying to unit test a very simple component. However, it appears some very common test helpers aren't being defined.
Read more >
Testing Helpers - Ember Guides
Testing helpers follows previous patterns shown in Testing Components, ... Helpers are best tested with integration tests, but can also be tested with...
Read more >
Testing Components with children - Testing Angular
An integration test of HomeComponent renders the child Components. The host elements are filled with the output of CounterComponent , ...
Read more >
Component Integration Testing in Ember - Mutually Human
I mentioned before that complicated pages make for complicated acceptance tests. Since an acceptance test treats the app as a black box, interacting...
Read more >
Basics of testing components - Angular
Test a component class on its own as you would test a service class. Component class testing should be kept very clean and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found