Update tests that check time and date formatting

This commit is contained in:
Michael Lange 2019-02-01 09:19:14 -08:00
parent dfd3b097d1
commit 91d8baa64e
7 changed files with 16 additions and 10 deletions

View File

@ -95,7 +95,7 @@ test('each task row should list high-level information for the task', function(a
assert.equal(taskRow.message, event.displayMessage, 'Event Message');
assert.equal(
taskRow.time,
moment(event.time / 1000000).format('MM/DD/YY HH:mm:ss'),
moment(event.time / 1000000).format("MMM DD, 'YY HH:mm:ss ZZ"),
'Event Time'
);

View File

@ -141,7 +141,7 @@ test('each allocation should have high-level details for the allocation', functi
assert.equal(allocationRow.shortId, allocation.id.split('-')[0], 'Allocation short ID');
assert.equal(
allocationRow.createTime,
moment(allocation.createTime / 1000000).format('MM/DD HH:mm:ss'),
moment(allocation.createTime / 1000000).format('MMM DD HH:mm:ss ZZ'),
'Allocation create time'
);
assert.equal(
@ -319,7 +319,11 @@ test('each node event shows basic node event information', function(assert) {
andThen(() => {
const eventRow = ClientDetail.events.objectAt(0);
assert.equal(eventRow.time, moment(event.time).format('MM/DD/YY HH:mm:ss'), 'Event timestamp');
assert.equal(
eventRow.time,
moment(event.time).format("MMM DD, 'YY HH:mm:ss ZZ"),
'Event timestamp'
);
assert.equal(eventRow.subsystem, event.subsystem, 'Event subsystem');
assert.equal(eventRow.message, event.message, 'Event message');
});
@ -452,7 +456,7 @@ test('when the node has a drain strategy with a positive deadline, the drain sta
);
assert.ok(
ClientDetail.drain.forcedDeadline.includes(forceDeadline.format('MM/DD/YY HH:mm:ss')),
ClientDetail.drain.forcedDeadline.includes(forceDeadline.format("MMM DD, 'YY HH:mm:ss ZZ")),
'Force deadline is shown as an absolute date'
);

View File

@ -204,7 +204,7 @@ test('when open, a deployment shows a list of all task groups and their respecti
assert.equal(taskGroupRow.unhealthy, taskGroup.unhealthyAllocs, 'Unhealthy Allocs');
assert.equal(
taskGroupRow.progress,
moment(taskGroup.requireProgressBy).format('MM/DD/YY HH:mm:ss'),
moment(taskGroup.requireProgressBy).format("MMM DD, 'YY HH:mm:ss ZZ"),
'Progress By'
);
});

View File

@ -21,7 +21,9 @@ test('/jobs/:id/versions should list all job versions', function(assert) {
test('each version mentions the version number, the stability, and the submitted time', function(assert) {
const version = versions.sortBy('submitTime').reverse()[0];
const formattedSubmitTime = moment(version.submitTime / 1000000).format('MM/DD/YY HH:mm:ss');
const formattedSubmitTime = moment(version.submitTime / 1000000).format(
"MMM DD, 'YY HH:mm:ss ZZ"
);
const versionRow = Versions.versions.objectAt(0);
assert.ok(versionRow.text.includes(`Version #${version.version}`), 'Version #');

View File

@ -24,7 +24,7 @@ test('/allocation/:id/:task_name should name the task and list high-level task i
assert.ok(Task.state.includes(task.state), 'Task state');
assert.ok(
Task.startedAt.includes(moment(task.startedAt).format('MM/DD/YY HH:mm:ss')),
Task.startedAt.includes(moment(task.startedAt).format("MMM DD, 'YY HH:mm:ss ZZ")),
'Task started at'
);
});
@ -142,7 +142,7 @@ test('each recent event should list the time, type, and description of the event
assert.equal(
recentEvent.time,
moment(event.time / 1000000).format('MM/DD/YY HH:mm:ss'),
moment(event.time / 1000000).format("MMM DD, 'YY HH:mm:ss ZZ"),
'Event timestamp'
);
assert.equal(recentEvent.type, event.type, 'Event type');

View File

@ -148,7 +148,7 @@ test('each allocation should show basic information about the allocation', funct
assert.equal(allocationRow.shortId, allocation.id.split('-')[0], 'Allocation short id');
assert.equal(
allocationRow.createTime,
moment(allocation.createTime / 1000000).format('MM/DD HH:mm:ss'),
moment(allocation.createTime / 1000000).format('MMM DD HH:mm:ss ZZ'),
'Allocation create time'
);
assert.equal(

View File

@ -194,7 +194,7 @@ test('each task group in the expanded task group section shows task group detail
assert.equal(findForTaskGroup('name').textContent.trim(), task.get('name'));
assert.equal(
findForTaskGroup('progress-deadline').textContent.trim(),
moment(task.get('requireProgressBy')).format('MM/DD/YY HH:mm:ss')
moment(task.get('requireProgressBy')).format("MMM DD, 'YY HH:mm:ss ZZ")
);
});
});