mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 17:35:43 +03:00
Acceptance test for disabled node write controls
This commit is contained in:
@@ -10,6 +10,8 @@ import Clients from 'nomad-ui/tests/pages/clients/list';
|
||||
import Jobs from 'nomad-ui/tests/pages/jobs/list';
|
||||
|
||||
let node;
|
||||
let managementToken;
|
||||
let clientToken;
|
||||
|
||||
const wasPreemptedFilter = allocation => !!allocation.preemptedByAllocation;
|
||||
|
||||
@@ -21,6 +23,11 @@ module('Acceptance | client detail', function(hooks) {
|
||||
server.create('node', 'forceIPv4', { schedulingEligibility: 'eligible' });
|
||||
node = server.db.nodes[0];
|
||||
|
||||
managementToken = server.create('token');
|
||||
clientToken = server.create('token');
|
||||
|
||||
window.localStorage.nomadTokenSecret = managementToken.secretId;
|
||||
|
||||
// Related models
|
||||
server.create('agent');
|
||||
server.create('job', { createAllocations: false });
|
||||
@@ -885,6 +892,14 @@ module('Acceptance | client detail', function(hooks) {
|
||||
|
||||
assert.notOk(ClientDetail.eligibilityError.isPresent);
|
||||
});
|
||||
|
||||
test('toggling eligibility and node drain are disabled when the active ACL token does not permit node write', async function(assert) {
|
||||
window.localStorage.nomadTokenSecret = clientToken.secretId;
|
||||
|
||||
await ClientDetail.visit({ id: node.id });
|
||||
assert.ok(ClientDetail.eligibilityToggle.isDisabled);
|
||||
assert.ok(ClientDetail.drainPopover.isDisabled);
|
||||
});
|
||||
});
|
||||
|
||||
module('Acceptance | client detail (multi-namespace)', function(hooks) {
|
||||
|
||||
@@ -117,6 +117,7 @@ export default create({
|
||||
label: text('[data-test-drain-popover] [data-test-popover-trigger]'),
|
||||
isOpen: isPresent('[data-test-drain-popover-form]'),
|
||||
toggle: clickable('[data-test-drain-popover] [data-test-popover-trigger]'),
|
||||
isDisabled: attribute('aria-disabled', '[data-test-popover-trigger]'),
|
||||
|
||||
deadlineToggle: toggle('[data-test-drain-deadline-toggle]'),
|
||||
deadlineOptions: {
|
||||
|
||||
Reference in New Issue
Block a user