chore: 🤖 implement remove sources abilities on targets

This commit is contained in:
Randall Morey committed 2021-09-27 16:55:19 -04:00
1 parent add826007d
commit 3ecb8b8ea9
6 files changed
+97 -37

No files matched your search

@@ -160,6 +160,16 @@ module('Acceptance | targets | credential-libraries', function (hooks) {
assert.equal(findAll('tbody tr').length, count - 1);
});
test('cannot remove credential libraries without proper authorization', async function (assert) {
assert.expect(1);
instances.target.authorized_actions =
instances.target.authorized_actions.filter(
(item) => item !== 'remove-credential-sources'
);
await visit(urls.credentialSources);
assert.notOk(find('tbody tr .rose-dropdown-button-danger'));
});
test('removing a target credential library which errors displays error messages', async function (assert) {
assert.expect(2);
this.server.post('/targets/:idMethod', () => {
@@ -75,7 +75,7 @@ module('Acceptance | targets | host-sources', function (hooks) {
assert.equal(findAll('tbody tr').length, targetHostSetCount);
});
test('can remove a host sets', async function (assert) {
test('can remove a host set', async function (assert) {
assert.expect(2);
const targetHostSetCount = instances.target.hostSets.length;
await visit(urls.targetHostSources);
@@ -84,6 +84,16 @@ module('Acceptance | targets | host-sources', function (hooks) {
assert.equal(findAll('tbody tr').length, targetHostSetCount - 1);
});
test('cannot remove a host set without proper authorization', async function (assert) {
assert.expect(1);
instances.target.authorized_actions =
instances.target.authorized_actions.filter(
(item) => item !== 'remove-host-sources'
);
await visit(urls.targetHostSources);
assert.notOk(find('tbody tr .rose-dropdown-button-danger'));
});
test('removing a target host set which errors displays error messages', async function (assert) {
assert.expect(2);
this.server.post('/targets/:idMethod', () => {