Add assertion for the volume k/v pairs in task rows

This commit is contained in:
Michael Lange
2020-02-13 17:10:01 -08:00
parent 060e84135c
commit 88c2af2f8d
2 changed files with 18 additions and 0 deletions

View File

@@ -91,6 +91,17 @@ module('Acceptance | allocation detail', function(hooks) {
const events = server.db.taskEvents.where({ taskStateId: task.id });
const event = events[events.length - 1];
const taskGroup = server.schema.taskGroups.where({
jobId: allocation.jobId,
name: allocation.taskGroup,
}).models[0];
const jobTask = taskGroup.tasks.models.find(m => m.name === task.name);
const volumes = jobTask.volumeMounts.map(volume => ({
name: volume.Volume,
source: taskGroup.volumes[volume.Volume].Source,
}));
Allocation.tasks[0].as(taskRow => {
assert.equal(taskRow.name, task.name, 'Name');
assert.equal(taskRow.state, task.state, 'State');
@@ -113,6 +124,12 @@ module('Acceptance | allocation detail', function(hooks) {
assert.ok(addressesText.includes(port.Label), `Found label ${port.Label}`);
assert.ok(addressesText.includes(port.Value), `Found value ${port.Value}`);
});
const volumesText = taskRow.volumes;
volumes.forEach(volume => {
assert.ok(volumesText.includes(volume.name), `Found label ${volume.name}`);
assert.ok(volumesText.includes(volume.source), `Found value ${volume.source}`);
});
});
});

View File

@@ -42,6 +42,7 @@ export default create({
message: text('[data-test-message]'),
time: text('[data-test-time]'),
ports: text('[data-test-ports]'),
volumes: text('[data-test-volumes]'),
hasUnhealthyDriver: isPresent('[data-test-icon="unhealthy-driver"]'),
hasProxyTag: isPresent('[data-test-proxy-tag]'),