Questions tagged [ember-qunit]

Unit test helpers for Ember applications.

Ember-qunit is a tool design to enhance the ability to write unit tests for Ember applications.

Ember QUnit uses your application's resolver to find and automatically create test subjects for you with the moduleFor and test helpers.

See more:

160 questions
1
vote
2 answers

How to test an Ember model's computed property that has relations dependencies?

I'm writing Qunit tests to test An Ember model, but having a hard time testing computed properties that have a relation dependency (the computed property triggers another model's computed property). The model that am testing (CoffeeScript): Customer…
Mawaheb
  • 822
  • 10
  • 21
1
vote
2 answers

Qunit testing an ember controller, located in a file that contains multiple controllers?

So, I've been trying to qunit test an Ember controller, The problem is, The controller is inside a coffeeScript file, that contains multiple controllers. Now, The ember testing guide says, In order to test a controller, I should use the 'moduleFor'…
Mawaheb
  • 822
  • 10
  • 21
1
vote
0 answers

Unit test a controller action that makes calls to async relationships

I have two models, Program and Project. A Program has many Projects. App.Program = DS.Model.extend projects: DS.hasMany 'project', async: true App.Project = DS.Model.extend program: DS.belongsTo 'program' I have an ArrayController responsible…
Feech
  • 4,072
  • 4
  • 28
  • 36
1
vote
2 answers

Testing an ember component that uses another component with separate template

I'm trying to test an emberjs component that uses another component. I'm using ember-qunit with the moduleForComponent method. In there I define that my component needs another component, needs: ['component:my-kitten']. But it seems that if you use…
Tom
  • 35
  • 6
0
votes
1 answer

Ember acceptance tests fail when ran all at once

I have about 5 acceptance tests which all pass when ran individually. When I want to run all of my tests, the acceptance tests will fail, except for the first one that was ran. All acceptance tests except for the first one will simply not render the…
0
votes
1 answer

Unit testing sessionStorage value in emberJS

I'm new to ember and trying to figure out how to unit test, using sinon, the sessionStorage based on url parameters when that page is visited. I've tried a few things but still can't get the desired result. It passes even if I change the…
dar
  • 43
  • 1
  • 6
0
votes
1 answer

Ember CLI tests fails inside dev container

I'm working in a VSCode Dev Container on Debian Release 10. I'm able to run CI=true ember test in my own terminal without fail but running it in my container instance throws; not ok 1 Chrome - [undefined ms] - error --- message: > …
Noah64
  • 89
  • 6
0
votes
0 answers

ember octane test-helpers: currentURL() returns addressbar URL()

I noticed currentURL() from @ember/test-helpers returns the actual test window address bar URL instead of the test's currentUrl(). I made sure that my ENV.locationType=none. Can someone spot something really obvious that I'm missing? Expected…
dpigera
  • 3,339
  • 5
  • 39
  • 60
0
votes
1 answer

How to fix 'service injection' for EmberJS integration test?

I have a tasks-table component that uses 'current-user' service. I inject the service into the component as displayed below import { inject as service } from '@ember/service'; export default Component.extend({ currentUser: service(), …
0
votes
1 answer

How to over ride a function of component in integration test in ember Qunit testing

I'm writing my first question here sorry for any ambiguity. I write an integration test for update-pw component which simple render update-pw and then fill input field with fillIn and then click save button which trigger the action savePW in…
0
votes
2 answers

Why do I get "Ajax authorization fails" in my tests

I am following the ember tutorials, and specifically I'm on services. I am 99.9% certain that I have the exact code in place -- I am copying by hand, because I believe that helps me absorb it more completely, but if anything fails I start using a…
The E
  • 697
  • 1
  • 9
  • 23
0
votes
1 answer

Get popup modal inner HTML in Ember Qunit test

I'm doing integration component testing with ember-qunit. So how to get popup modal body text once its open from an action. text-bar-test test('it renders with title', function(assert) { assert.expect(1); this.render(hbs`{{text-bar}}`); …
Shiv Kumar Baghel
  • 2,464
  • 6
  • 18
  • 34
0
votes
1 answer

"Missing translation" when running an Ember acceptance test related to ember-i18n package

I'm writing acceptance tests for an Ember component which allows the user to toggle their i18n settings via a dropdown provided by the ember-select-list package. I'm also using the ember-i18n package for the i18n settings. The dropdown component…
Richie Thomas
  • 3,073
  • 4
  • 32
  • 55
0
votes
1 answer

Retrieve document.title from AUT from acceptance test - Ember 2

I am testing an ember 2.13 app. I want to retrieve the value of the page title, but doing so as document.title from the test grabs the title from test suite page. I may be overlooking a simple ember-qunit feature here. Any hint?
j4v1
  • 1,457
  • 1
  • 22
  • 32
0
votes
0 answers

Qunit serializer test is returning “Cannot read property ‘push’ of null”

Ember serializer test below is failing with “Cannot read property ‘push’ of null”. I am using Pretender mock server library. The test is failing when I'm calling a store.findRecord() Note how there are no relationships in the assignment…