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
2
votes
1 answer

How to add integration tests for components defined in an ember-addon

Here is the structure of my ember-addon. addon/ .. components/ .... my-component/ ...... component.js ...... style.less ...... template.hbs .. engine.js .. routes.js app/ .. components/ .... my-component/ ...... component.js .. etc .. tests/ …
shane
  • 246
  • 2
  • 17
2
votes
1 answer

Qunit _initProperties is not a function

I've run into some strange behavior here and wanted to see if anybody knew why it occurs. I've written a simple Ember QUnit test and want to share some data between each test, just to reduce clutter. Test import Ember from 'ember' import {…
shane
  • 246
  • 2
  • 17
2
votes
1 answer

Injecting service into a mixin Ember2.3+

I am having a problem with an error that pops up in my unit test suite when I try to check a service injected into Mixin since getOwner() has been added into Ember (deprecation guide here). This is my mixin: import Ember from 'ember'; export…
Pavol
  • 1,200
  • 8
  • 20
2
votes
1 answer

Ember acceptance tests fail when running all at once

I have problems with acceptance tests (ember 0.10.0). The thing is, tests run successfully if I run them one by one (passing test ID in URL), but when I try to run them all at once, they fail cause of some async problems I think (such as trying to…
2
votes
1 answer

Ember Test Initializer that Requires Model

I have an initializer that registers some modules with the application from a JSON object on the page in a script tag. Works fine in the application but the test fails because it cannot find the models that are…
BillPull
  • 6,853
  • 15
  • 60
  • 99
2
votes
2 answers

Unit test computed property on an Ember controller

The code from my controllers/cart.js: export default Ember.Controller.extend({ cartTotal: Ember.computed('model.@each.subTotal', function() { return this.model.reduce(function(subTotal, product) { var total = subTotal +…
zshnr
  • 279
  • 4
  • 12
2
votes
2 answers

Component test Ember-CLI with {{link-to}} helpers

I have what I believe to be are 3 very simple tests. 1) Check a component renders property (Ember-CLI automatically generates this) 2) Click a class which navigates to the 'user.index' route (it's a {{link-to}}) 3) Click a class which navigates to…
Chris
  • 3,004
  • 3
  • 21
  • 26
2
votes
1 answer

Ember QUnit moduleFor (testing) adapter retrieving Store

I am writing test for my custom DS.RESTAdapter, which uses our own SDK as transporter instead of ajax calls. Now, I want to test the adapters find, findAll, findQuery ... functions which require me to pass an instance of store as a parameter. For…
IBQ
  • 21
  • 3
2
votes
1 answer

Attempting to register an unknown factory: `controller:application`

Here's a simplified version of my PuzzleController: // app/controllers/puzzle.js export default Em.ObjectController.extend({ needs: ['application'] }); And here's my controller test: // tests/unit/controllers/puzzle-test.js import { …
nnyby
  • 4,748
  • 10
  • 49
  • 105
2
votes
0 answers

Ember testing: Visiting external URL for integration test

I'm helping redo a site that currently exists. One of the tests I'm trying to run is make sure that when I run a search on the old site I get the same results on the same search on the new site. Is there a way to programmatically visit the old site…
James White
  • 535
  • 10
  • 24
2
votes
1 answer

EmberJS: How to test a controller action with moduleFor of ember-qunit, which uses store of ember-data

I want to test a controller action like this: createNewBase: function () { var attributesForNewBase = this.get( 'model' ).getProperties( ... ), self = this, newBase = this.store.createRecord( ..., { ... } ); …
2
votes
1 answer

Testing visibility of an element

I'm writing integrations tests for an Ember app using QUnit. Is there anyway to test if an element is visible? My experience with integration testing comes from Capybara which detects only visible elements by default.
niftygrifty
  • 3,452
  • 2
  • 28
  • 49
2
votes
1 answer

Ember auth transition.retry() after login doesn't transit while testing

I am having some issues with testing my login and related features of my app. The app works perfectly, but the test fails. For testing, I use a Qunit with karma I have created few authenticated routes(say accounts) which one can only visit after…
chetang
  • 198
  • 3
  • 19
1
vote
0 answers

Emberjs acceptance test not rendering DOM elements

When running a series of acceptance tests, only the first one will correctly work. All those who follow will not even render the DOM. I've tried looking for the reason but haven't been able to find a solution yet. To clarify, all acceptance tests…
1
vote
1 answer

Error: 'ReferenceError: pauseTest is not defined' in integration tests with moduleForComponent syntax

The pauseTest() function from ember-qunit does not work as expected in Integration tests with the old syntax import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; moduleForComponent('my-component,…
Alex Strizhak
  • 910
  • 1
  • 12
  • 22