open-vault/ui/tests/pages/policies/index.js
Matthew Irish c31671ce04
Bug fix - ui context menu (#6018)
* add dot-to-dash helper

* fix context menu on policy page and add test for deletion

* use dot-to-dash where we use confirm component

* fix acceptance test
2019-01-09 12:30:19 -06:00

21 lines
677 B
JavaScript

import { text, create, collection, clickable, visitable } from 'ember-cli-page-object';
export default create({
visit: visitable('/vault/policies/:type'),
policies: collection('[data-test-policy-item]', {
name: text('[data-test-policy-name]'),
}),
row: collection('[data-test-policy-link]', {
name: text(),
menu: clickable('[data-test-popup-menu-trigger]'),
}),
findPolicyByName(name) {
return this.policies.filterBy('name', name)[0];
},
delete: clickable('[data-test-confirm-action-trigger]', {
testContainer: '#ember-testing',
}),
confirmDelete: clickable('[data-test-confirm-button]', {
testContainer: '#ember-testing',
}),
});