feat: 🎸 implement add sources on targets

This commit is contained in:
Randall Morey committed 2021-09-28 14:09:11 -04:00
1 parent 3ecb8b8ea9
commit 021be5d689
6 files changed
+68 -8

No files matched your search

@@ -15,6 +15,17 @@ module('Unit | Abilities | Target', function (hooks) {
assert.notOk(service.can('connect target', model));
});
test('it reflects when a given target may add host sources', function (assert) {
assert.expect(2);
const service = this.owner.lookup('service:can');
const model = {
authorized_actions: ['add-host-sources'],
};
assert.ok(service.can('addHostSources target', model));
model.authorized_actions = [];
assert.notOk(service.can('addHostSources target', model));
});
test('it reflects when a given target may remove host sources', function (assert) {
assert.expect(2);
const service = this.owner.lookup('service:can');
@@ -26,6 +37,17 @@ module('Unit | Abilities | Target', function (hooks) {
assert.notOk(service.can('removeHostSources target', model));
});
test('it reflects when a given target may add crednetial sources', function (assert) {
assert.expect(2);
const service = this.owner.lookup('service:can');
const model = {
authorized_actions: ['add-credential-sources'],
};
assert.ok(service.can('addCredentialSources target', model));
model.authorized_actions = [];
assert.notOk(service.can('addCredentialSources target', model));
});
test('it reflects when a given target may remove crednetial sources', function (assert) {
assert.expect(2);
const service = this.owner.lookup('service:can');