Skip to content

Commit

Permalink
fix auth form tests
Browse files Browse the repository at this point in the history
  • Loading branch information
meirish committed Oct 1, 2018
1 parent b2979e3 commit 8436962
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ui/tests/integration/components/auth-form-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ const workingAuthService = Service.extend({

const routerService = Service.extend({
transitionTo() {
return resolve();
return {
followRedirects() {
return resolve();
},
};
},
replaceWith() {
return resolve();
Expand Down Expand Up @@ -142,6 +146,7 @@ module('Integration | Component | auth form', function(hooks) {
});
});

this.set('cluster', EmberObject.create({}));
await render(hbs`{{auth-form cluster=cluster }}`);
await settled();
assert.equal(component.tabs.length, 2, 'renders a tab for userpass and Other');
Expand All @@ -165,6 +170,7 @@ module('Integration | Component | auth form', function(hooks) {
});
});

this.set('cluster', EmberObject.create({}));
this.set('selectedAuth', 'foo/');
await render(hbs`{{auth-form cluster=cluster selectedAuth=selectedAuth}}`);
await component.login();
Expand All @@ -188,6 +194,7 @@ module('Integration | Component | auth form', function(hooks) {
return [200, { 'Content-Type': 'application/json' }, JSON.stringify({ data: { auth: methods } })];
});
});
this.set('cluster', EmberObject.create({}));
await render(hbs`{{auth-form cluster=cluster}}`);
await settled();
server.shutdown();
Expand All @@ -214,6 +221,7 @@ module('Integration | Component | auth form', function(hooks) {

let wrappedToken = '54321';
this.set('wrappedToken', wrappedToken);
this.set('cluster', EmberObject.create({}));
await render(hbs`{{auth-form cluster=cluster wrappedToken=wrappedToken}}`);
later(() => run.cancelTimers(), 50);
await settled();
Expand Down

0 comments on commit 8436962

Please sign in to comment.