a69f9b6429
* mess with return * removing filter for testing on circle ci * no only enterprise * testing * revert * add settled * sprinkled those settleds * stuff
24 lines
667 B
JavaScript
24 lines
667 B
JavaScript
import { create, visitable, fillable, clickable } from 'ember-cli-page-object';
|
|
import { settled } from '@ember/test-helpers';
|
|
|
|
export default create({
|
|
visit: visitable('/vault/auth'),
|
|
logout: visitable('/vault/logout'),
|
|
submit: clickable('[data-test-auth-submit]'),
|
|
tokenInput: fillable('[data-test-token]'),
|
|
login: async function(token) {
|
|
// make sure we're always logged out and logged back in
|
|
await this.logout();
|
|
await settled();
|
|
await this.visit({ with: 'token' });
|
|
await settled();
|
|
if (token) {
|
|
await this.tokenInput(token).submit();
|
|
return;
|
|
}
|
|
|
|
await this.tokenInput('root').submit();
|
|
return;
|
|
},
|
|
});
|