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

EmberJs-How to reject an Ember.RSVP.Promise in qunit Unit TEST?

var stubMyService=Ember.Object.extend({ //'authenticator:ooion( OAuth,username, password) authenticate(OAuth2,username,password) { return new Ember.RSVP.Promise(function(reject){ …
Mehak Fatima
  • 263
  • 1
  • 4
0
votes
1 answer

Why does my Ember component integration test pass when I run it in isolation, but fail when I run the full suite?

I have a simple, bare-bones integration test for a component which depends on an i18n service (which the test injects). The component itself is a simple select dropdown from ember-select-list, with a default value of Select Language. Here's the…
Richie Thomas
  • 3,073
  • 4
  • 32
  • 55
0
votes
1 answer

Service not injected into component's integration test

I have a service Foo (e.g. app/services/foo.js): import Ember from 'ember'; const FooService = Ember.Service.extend({ myMethod() { ... } }); export default FooService; which I initialize in app's initializers (e.g. app/initializers/foo.js),…
emil.c
  • 1,987
  • 2
  • 26
  • 46
0
votes
1 answer

Ember integration test + mocking model with relationships + ember-deferred-content add-on

I am using the {{deferred-content}} component within my component's template, hooked into a model object's asset relationship. Here is a stripped-down version of what I'm trying to do: {{#unless showUploadForm}} {{#deferred-content…
Chris Peters
  • 17,918
  • 6
  • 49
  • 65
0
votes
1 answer

Ember cannot call writableChainWatchers after the object is destroyed

I've had my share of obscure error messages in Ember tests with no useful stack trace or any other information to figure out the underlying cause, but this case takes the prize for being the most obscure of them all. I have this Ember app where…
Ernesto
  • 3,837
  • 6
  • 35
  • 56
0
votes
1 answer

How can I test a class function with Ember qUnit?

I have a simple object (in app/models/fruit.js) that has a static method: import Ember from 'ember'; const Fruit = Ember.Object.extend({ }); Fruit.reopenClass({ createFruit() { } } export default Fruit; and I have a test (in…
Timmy O'Mahony
  • 53,000
  • 18
  • 155
  • 177
0
votes
1 answer

Qunit for rendering modal in application route

In my application route, I have code provided from the ember website on how to render the opening and closing of modals. https://guides.emberjs.com/v1.10.0/cookbook/user_interface_and_interaction/using_modal_dialogs/ export default…
Jerry
  • 11
  • 1
  • 2
0
votes
1 answer

Tests total failure after abrupt Ember upgrade

I am working on an app that was stuck for a while on Ember 2.2, and we finally devoted the time to make the upgrade to Ember 2.10. After fixing all the deprecation warnings in the code, and upgrading the versions of some of the dependencies…
Ernesto
  • 3,837
  • 6
  • 35
  • 56
0
votes
1 answer

Ember qunit tests are being called twice

I recently upgraded my "ember-cli" to "2.10.0" and "ember-cli-qunit" to "3.0.1" but each test module is getting run twice. However when I try the code in jsbin I am unable to recreate the issue. My test looks like: import Qunit from…
Deewendra Shrestha
  • 2,313
  • 1
  • 23
  • 53
0
votes
1 answer

Integration test rendering process - EmberJS

I'm writing an integration test for one of my addon components. I've also linked it to a sibling project using npm link: .. projects/ .... my-project/ .... my-linked-project/ I use one of the my-linked-project mixins in the my-project component in…
shane
  • 246
  • 2
  • 17
0
votes
1 answer

How do I do QUnit Integration testing in Ember for a component that uses a helper that outputs HTML?

I have an Ember component that uses a helper that creates HTML and I am trying to create a test that checks the HTML that results from the combined component and helper HTML. Example... component produces:
helper produces:
Micki T
  • 71
  • 5
0
votes
1 answer

How can globally I mock/replace components in integration tests?

I have a component "nested" which makes a web request, and I'm using this component from another component "parent". I'm trying to write some integration tests for "parent", but they are failing as the "nested" component's web requests are…
Matt d'
  • 137
  • 1
  • 7
0
votes
1 answer

Access Chrome URL object in ember test

I am testing an ember component that will do a call to an external method that returns a promise and calls the createObjectURL from the URL object of the navigator: @fetch(@get 'self').then((blob) => url = URL.createObjectURL blob …
Urco
  • 365
  • 3
  • 14
0
votes
1 answer

Nice way of making custom before/after for groups of tests

I'm writing some tests for an ember project, and I'm looking for a nice way to group certain tests so they can share the same setup/teardown methods. From what I can tell, it can be done in this way: moduleFor('adapter:application', 'Unit | Adapter…
Matt d'
  • 137
  • 1
  • 7
0
votes
1 answer

Ember Tests Page Returns 404 Error

I'm trying to add unit tests to an existing project that was developed over the last two years and updated regularly to newest ember version. To do that, I started by running $ ember test -s version: 1.13.13 Building... Build successful -…
anlumo
  • 143
  • 2
  • 7