Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

update tests

Jason Kentccc434416258
diff --git a/e2e/features/layers/layer-picker-test.js b/e2e/features/layers/layer-picker-test.js
index 2ec971fd4..a1cc39770 100644
--- a/e2e/features/layers/layer-picker-test.js
+++ b/e2e/features/layers/layer-picker-test.js
@@ -168,7 +168,7 @@ module.exports = {
c.click(addLayers);
// Confirm available facet still enabled but date changed
- c.assert.containsText(availableFilterTextEl, 'Available 2012 Apr 14');
+ c.assert.containsText(availableFilterTextEl, 'Available 2012 APR 14');
c.expect.element(availableFilterCheckboxInput).to.be.selected;
},
'Disabling coverage filter updates list': (c) => {
diff --git a/e2e/features/smart-handoff/smart-handoff-test.js b/e2e/features/smart-handoff/smart-handoff-test.js
index 3957ad0b3..c3fa58397 100644
--- a/e2e/features/smart-handoff/smart-handoff-test.js
+++ b/e2e/features/smart-handoff/smart-handoff-test.js
@@ -62,7 +62,7 @@ module.exports = {
// Verify granules and date are correct
c.expect
.element('.granule-count-header')
- .to.have.text.equal('Available granules for 2019 Dec 01:');
+ .to.have.text.equal('Available granules for 2019 DEC 01:');
c.waitForElementVisible('.granule-count-info', TIME_LIMIT);
},
diff --git a/e2e/features/timeline/timeline-test.js b/e2e/features/timeline/timeline-test.js
index f20939f19..ff0a38d5c 100644
--- a/e2e/features/timeline/timeline-test.js
+++ b/e2e/features/timeline/timeline-test.js
@@ -136,7 +136,7 @@ module.exports = {
},
// date subdaily tooltip date present on load
- 'Date subdaily tooltip date present load': (c) => {
+ 'Date subdaily tooltip date present on load': (c) => {
c.url(c.globals.url + localQueryStrings.subdailyLayerIntervalTimescale);
c.waitForElementVisible('.date-tooltip', TIME_LIMIT)
.assert.containsText('.date-tooltip', '2019 OCT 04 09:46Z (DOY 277)');
diff --git a/web/js/modules/date/util.js b/web/js/modules/date/util.js
index 7c821da3d..a48a2fd65 100644
--- a/web/js/modules/date/util.js
+++ b/web/js/modules/date/util.js
@@ -356,7 +356,7 @@ export const coverageDateFormatter = (dateType, date, period) => {
const parsedDate = parseDate(date);
switch (period) {
case 'subdaily':
- dateString = `${moment(parsedDate).format('YYYY MMM DD HH:mm')}Z`.toUpperCase();
+ dateString = formatDisplayDate(parsedDate, true);
break;
case 'yearly':
@@ -378,11 +378,9 @@ export const coverageDateFormatter = (dateType, date, period) => {
};
export const formatDisplayDate = (date, subdaily) => {
- const format = subdaily ? 'YYYY MMM DD HH:mmZ' : 'YYYY MMM DD';
- return moment
- .utc(date)
- .format(format)
- .toUpperCase();
+ const format = subdaily ? 'YYYY MMM DD HH:mm' : 'YYYY MMM DD';
+ const dateString = moment.utc(date).format(format);
+ return `${dateString.toUpperCase()}${subdaily ? 'Z' : ''}`;
};
export const formatISODate = (date) => moment(date).format('YYYY-MM-DD');