Files
threshold-ui/addons/api/tests/unit/abilities/host-set-test.js
T
hashiccandLisbet Alvarez 3a847605ed Reapply ember-can upgrade (#3111)
* chore: 🤖 reapply previous ember-can upgrade from #3093

* chore: 🤖 add missing ember-inflector dependency

* chore: 🤖 move @ember/string to be a dependency in desktop

* chore: 🤖 re-run pnpm install to resolve lockfile dupe key error

* chore: 🤖 remove unused abilities service injections

Co-Authored-By: Lisbet Alvarez <107949262+lisbet-alvarez@users.noreply.github.com>

---------

Co-authored-by: Lisbet Alvarez <107949262+lisbet-alvarez@users.noreply.github.com>
2026-02-24 13:48:34 -05:00

32 lines
1.0 KiB
JavaScript

/**
* Copyright IBM Corp. 2021, 2026
* SPDX-License-Identifier: BUSL-1.1
*/
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Abilities | Host Set', function (hooks) {
setupTest(hooks);
test('it reflects when a given host set resource may add hosts based on authorized_actions', function (assert) {
const service = this.owner.lookup('service:abilities');
const model = {
authorized_actions: ['add-hosts'],
};
assert.ok(service.can('addHosts hostSet', model));
model.authorized_actions = [];
assert.notOk(service.can('addHosts hostSet', model));
});
test('it reflects when a given hostSet resource may remove hosts based on authorized_actions', function (assert) {
const service = this.owner.lookup('service:abilities');
const model = {
authorized_actions: ['remove-hosts'],
};
assert.ok(service.can('removeHosts hostSet', model));
model.authorized_actions = [];
assert.notOk(service.can('removeHosts hostSet', model));
});
});