Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Tests failing at data picker. Submitting for peer review.

Stephan Wlodarczyk5692c3a4b092
diff --git a/e2e/features/timeline/timeline-mobile-test.js b/e2e/features/timeline/timeline-mobile-test.js
index ca70f8030..443035299 100644
--- a/e2e/features/timeline/timeline-mobile-test.js
+++ b/e2e/features/timeline/timeline-mobile-test.js
@@ -1,37 +1,42 @@
const skipTour = require('../../reuseables/skip-tour.js');
+const moment = require('moment');
const mobileDatePickerSelectBtn = '#date-selector-main .mobile-date-picker-select-btn';
const nextDayArrowContainer = '#right-arrow-group';
const datepickerHeader = '.datepicker .datepicker-header';
const TIME_LIMIT = 10000;
+const TODAY = moment(new Date()).format('YYYY-MM-DD');
+const YESTERDAY = moment(new Date()).subtract(1, 'days').format('YYYY-MM-DD');
+const TOMORROW = moment(new Date()).add(1, 'days').format('YYYY-MM-DD');
module.exports = {
before: c => {
skipTour.loadAndSkipTour(c, TIME_LIMIT);
- c.url(c.globals.url + '?now=2013-03-15T0');
+ c.url(c.globals.url + '?now=' + TODAY);
c.resizeWindow(375, 667); // iPhone 6/7/8 dimensions
},
'date.mob.init.2a: Before 3:00 UTC: load yesterdays date': c => {
c.waitForElementVisible(mobileDatePickerSelectBtn, TIME_LIMIT, e => {
- c.assert.containsText(mobileDatePickerSelectBtn, '2013-03-14');
+ c.assert.containsText(mobileDatePickerSelectBtn, YESTERDAY);
});
},
'date.mob.init.2b: Before 3:00 UTC: right button is not disabled': c => {
c.expect.element(nextDayArrowContainer).to.be.present;
c.expect.element(nextDayArrowContainer + '.button-disabled').to.not.be.present;
c.click(nextDayArrowContainer);
- c.waitForElementVisible(nextDayArrowContainer + '.button-disabled', TIME_LIMIT);
+ c.waitForElementVisible(nextDayArrowContainer, TIME_LIMIT);
},
'date.mob.init.3a: After 3:00 UTC: load todays date': c => {
- c.url(c.globals.url + '?now=2013-03-15T4');
+ c.url(c.globals.url + '?now=' + TODAY + 'T4');
c.waitForElementVisible(mobileDatePickerSelectBtn, TIME_LIMIT, e => {
- c.assert.containsText(mobileDatePickerSelectBtn, '2013-03-15');
+ c.assert.containsText(mobileDatePickerSelectBtn, TODAY);
});
},
'date.mob.init.3b:After 3:00 UTC: right button is disabled': c => {
c.expect.element(nextDayArrowContainer).to.be.present;
+ c.click(nextDayArrowContainer);
c.expect.element(nextDayArrowContainer + '.button-disabled').to.be.present;
},
- 'date.mob.range.1: Date label should show 2013-07-20': c => {
+ 'date.mob.range.1: Date label should show 2013-03-15': c => {
c.url(c.globals.url + '?now=2013-03-15T12');
c.waitForElementVisible(mobileDatePickerSelectBtn, TIME_LIMIT, e => {
c.assert.containsText(mobileDatePickerSelectBtn, '2013-03-15');
diff --git a/nightwatch.conf.js b/nightwatch.conf.js
index 6251795bd..c8c5b7853 100644
--- a/nightwatch.conf.js
+++ b/nightwatch.conf.js
@@ -1,7 +1,7 @@
const seleniumServer = require('selenium-server-standalone-jar');
const chromedriver = require('chromedriver');
const geckodriver = require('geckodriver');
-const files = './e2e/features';
+const files = './e2e/features/timeline/timeline-mobile-test.js';
module.exports = {
output_folder: 'e2e/reports',
globals_path: 'e2e/globals.js',
@@ -34,7 +34,7 @@ module.exports = {
prefs: { 'profile.managed_default_content_settings.notifications': 1 }
}
}
- },
+ }/*
chromeHeadless: {
desiredCapabilities: {
browserName: 'chrome',
@@ -59,6 +59,6 @@ module.exports = {
args: ['--headless']
}
}
- }
+ } */
}
};
diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.js
index 50280ba15..a20659ef7 100644
--- a/web/js/containers/timeline/timeline.js
+++ b/web/js/containers/timeline/timeline.js
@@ -1273,7 +1273,9 @@ function mapStateToProps(state) {
hasSubdailyLayers = hasSubDaily(layers[compare.activeString]);
endTime = layersLastDateTime(layers[activeString], config);
}
- endTime = appNow;
+ /** endTime = appNow; This was originally here, wondering why the
+ above logic is there when it gets set here **/
+ endTime = state.config.todaysDate;
const dimensionsAndOffsetValues = getOffsetValues(
screenWidth,
diff --git a/web/js/location.js b/web/js/location.js
index 509f5701c..aa8c50f19 100644
--- a/web/js/location.js
+++ b/web/js/location.js
@@ -161,7 +161,6 @@ const getParameters = function(config, parameters) {
const appNow = get(state, 'date.appNow');
const appNowString = util.toISOStringSeconds(appNow);
const initialDateString = util.toISOStringSeconds(initialDate);
-
return !compareIsActive && !isCompareA
? util.toISOStringSeconds(dateB) === appNowString
? undefined
diff --git a/web/js/main.js b/web/js/main.js
index d5a7876d1..423f0f20c 100644
--- a/web/js/main.js
+++ b/web/js/main.js
@@ -67,10 +67,15 @@ window.onload = () => {
? new Date((config.pageLoadTime).setUTCDate(config.pageLoadTime.getUTCDate() - 1))
: config.pageLoadTime;
+ config.todaysDate = new Date().getUTCHours() < 3
+ ? new Date((new Date()).setUTCDate(new Date().getUTCDate() - 1))
+ : new Date();
+
config.palettes = {
rendered: {},
custom: {}
};
+
elapsed('Config loaded', config.now, parameters);
// Determine which layers need to be preloaded
let layers = [];