open-vault/ui/tests/pages/secrets/backend/list.js
Matthew Irish 0b2a63a6a3
UI secret navigation improvements (#5976)
* don't pass id when using createRecord

* add find nearest ancestor mixin

* re-throw the error if we've deleted something and encounter a 404

* use the with-nav-to-nearest-ancestor mixin

* add some comments

* add acceptance test to verify new behavior

* yield final transition in ec task
2018-12-20 13:46:37 -06:00

30 lines
1.1 KiB
JavaScript

import { create, collection, text, visitable, clickable, isPresent } from 'ember-cli-page-object';
import { getter } from 'ember-cli-page-object/macros';
export default create({
visit: visitable('/vault/secrets/:backend/list/:id'),
visitRoot: visitable('/vault/secrets/:backend/list'),
create: clickable('[data-test-secret-create]'),
createIsPresent: isPresent('[data-test-secret-create]'),
configure: clickable('[data-test-secret-backend-configure]'),
configureIsPresent: isPresent('[data-test-secret-backend-configure]'),
tabs: collection('[data-test-tab]'),
secrets: collection('[data-test-secret-link]', {
menuToggle: clickable('[data-test-popup-menu-trigger]'),
id: text(),
click: clickable(),
}),
menuItems: collection('.ember-basic-dropdown-content li', {
testContainer: '#ember-testing',
}),
delete: clickable('[data-test-confirm-action-trigger]', {
testContainer: '#ember-testing',
}),
confirmDelete: clickable('[data-test-confirm-button]', {
testContainer: '#ember-testing',
}),
backendIsEmpty: getter(function() {
return this.secrets.length === 0;
}),
});