You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import Ember from 'ember';
import { module, test } from 'qunit';
import FactoryGuy from 'ember-data-factory-guy';
import TestHelper from 'ember-data-factory-guy/factory-guy-test-helper';
import startApp from 'web-ui/tests/helpers/start-app';
var App;
var hardware;
module('Acceptance | UI | Hardware Status', {
beforeEach: function() {
App = startApp();
TestHelper.setup();
authenticateSession();
setup(true, true);
Ember.run(function () {
hardware = FactoryGuy.makeList('hardware', 2, {type: "quad"});
TestHelper.handleCreate('hardware');
TestHelper.handleQuery('hardware', {"type": "quad"}, hardware);
})
},
afterEach: function() {
Ember.run(function () {
TestHelper.teardown();
App.destroy();
});
}
});
Afterwards a handle query in the first test that runs will always fail and throw and adaptor error:
test('hardware status route index', function(assert) {
assert.expect(5);
visit('admin/hardware-status/');
andThen(function() {
assert.equal(currentPath(), 'admin.hardware-status.index');
//GET http://localhost:1337/v1/hardware?type=quad 403 (Forbidden)
// Error while processing route: admin.hardware-status.index Adapter operation failed Error: Adapter operation failed
// handleQuery does not seem to be handling the query thus breaking the test
});
});
but bizarrely if I run the same test n times in succession all but the first will pass
test('hardware status route index', function(assert) {
visit('admin/hardware-status/');
andThen(function() {
assert.equal(currentPath(), 'admin.hardware-status.index');
//GET http://localhost:1337/v1/hardware?type=quad 403 (Forbidden)
// Error while processing route: admin.hardware-status.index Adapter operation failed Error: Adapter operation failed
// handleQuery does not seem to be handling the query thus breaking the test
});
test('hardware status route index 2', function(assert) {
assert.expect(5);
visit('admin/hardware-status/');
andThen(function() {
assert.equal(currentPath(), 'admin.hardware-status.index');
//No GET, Query handled, everything works, test passes
});
});
adding an empty test visists the route and makes no assertions fixes it but obviously that isnt desirable. Any thoughts on why handleQuery seems to noop on the first run through?
The text was updated successfully, but these errors were encountered:
here is my setup block:
Afterwards a handle query in the first test that runs will always fail and throw and adaptor error:
but bizarrely if I run the same test n times in succession all but the first will pass
adding an empty test visists the route and makes no assertions fixes it but obviously that isnt desirable. Any thoughts on why handleQuery seems to noop on the first run through?
The text was updated successfully, but these errors were encountered: