mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 17:35:43 +03:00
@@ -54,6 +54,7 @@ module('Acceptance | allocation detail', function(hooks) {
|
||||
node.id.split('-')[0],
|
||||
'Node short id is in the subheading'
|
||||
);
|
||||
assert.ok(Allocation.execButton.isPresent);
|
||||
|
||||
assert.equal(document.title, `Allocation ${allocation.name} - Nomad`);
|
||||
|
||||
@@ -452,6 +453,12 @@ module('Acceptance | allocation detail (not running)', function(hooks) {
|
||||
'Empty message is appropriate'
|
||||
);
|
||||
});
|
||||
|
||||
test('the exec and stop/restart buttons are absent', async function(assert) {
|
||||
assert.notOk(Allocation.execButton.isPresent);
|
||||
assert.notOk(Allocation.stop.isPresent);
|
||||
assert.notOk(Allocation.restart.isPresent);
|
||||
});
|
||||
});
|
||||
|
||||
module('Acceptance | allocation detail (preemptions)', function(hooks) {
|
||||
|
||||
@@ -49,6 +49,18 @@ export default function moduleForJob(title, context, jobFactory, additionalTests
|
||||
assert.equal(currentURL(), `/jobs/${job.id}/evaluations`);
|
||||
});
|
||||
|
||||
test('the title buttons are dependent on job status', async function(assert) {
|
||||
if (job.status === 'dead') {
|
||||
assert.ok(JobDetail.start.isPresent);
|
||||
assert.notOk(JobDetail.stop.isPresent);
|
||||
assert.notOk(JobDetail.execButton.isPresent);
|
||||
} else {
|
||||
assert.notOk(JobDetail.start.isPresent);
|
||||
assert.ok(JobDetail.stop.isPresent);
|
||||
assert.ok(JobDetail.execButton.isPresent);
|
||||
}
|
||||
});
|
||||
|
||||
if (context === 'allocations') {
|
||||
test('allocations for the job are shown in the overview', async function(assert) {
|
||||
assert.ok(JobDetail.allocationsSummary, 'Allocations are shown in the summary section');
|
||||
|
||||
@@ -20,6 +20,10 @@ export default create({
|
||||
stop: twoStepButton('[data-test-stop]'),
|
||||
restart: twoStepButton('[data-test-restart]'),
|
||||
|
||||
execButton: {
|
||||
scope: '[data-test-exec-button]',
|
||||
},
|
||||
|
||||
details: {
|
||||
scope: '[data-test-allocation-details]',
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
} from 'ember-cli-page-object';
|
||||
|
||||
import allocations from 'nomad-ui/tests/pages/components/allocations';
|
||||
import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button';
|
||||
|
||||
export default create({
|
||||
visit: visitable('/jobs/:id'),
|
||||
@@ -22,6 +23,13 @@ export default create({
|
||||
return this.tabs.toArray().findBy('id', id);
|
||||
},
|
||||
|
||||
stop: twoStepButton('[data-test-stop]'),
|
||||
start: twoStepButton('[data-test-start]'),
|
||||
|
||||
execButton: {
|
||||
scope: '[data-test-exec-button]',
|
||||
},
|
||||
|
||||
stats: collection('[data-test-job-stat]', {
|
||||
id: attribute('data-test-job-stat'),
|
||||
text: text(),
|
||||
|
||||
Reference in New Issue
Block a user