Interactive interface for browsing global, full-resolution satellite imagery
remove init second date logic and update test
Ed Platoc0586589d4af
diff --git a/web/js/modules/compare/actions.js b/web/js/modules/compare/actions.jsindex 0154d630c..c889249c3 100644--- a/web/js/modules/compare/actions.js+++ b/web/js/modules/compare/actions.js@@ -1,5 +1,5 @@import { initSecondLayerGroup } from '../layers/actions';-import { initSecondDate, clearPreload } from '../date/actions';+import { clearPreload } from '../date/actions';import {CHANGE_STATE,TOGGLE_ON_OFF,@@ -17,7 +17,6 @@ export function toggleCompareOnOff() {return (dispatch, getState) => {if (!getState().compare.bStatesInitiated) {dispatch(initSecondLayerGroup());- dispatch(initSecondDate());}dispatch({ type: TOGGLE_ON_OFF });};diff --git a/web/js/modules/compare/actions.test.js b/web/js/modules/compare/actions.test.jsindex 921c83152..0620fd2e8 100644--- a/web/js/modules/compare/actions.test.js+++ b/web/js/modules/compare/actions.test.js@@ -9,22 +9,20 @@ import {} from './actions';import { INIT_SECOND_LAYER_GROUP } from '../layers/constants';import fixtures from '../../fixtures';-import { INIT_SECOND_DATE, CLEAR_PRELOAD } from '../date/constants';+import { CLEAR_PRELOAD } from '../date/constants';const middlewares = [thunk];const state = fixtures.getState();-test('toggleCompareOnOff dispactches two actions', () => {+test('toggleCompareOnOff dispatches one action', () => {const mockStore = configureMockStore(middlewares);const store = mockStore(state);store.dispatch(toggleCompareOnOff());const firstResponse = store.getActions()[0];const secondResponse = store.getActions()[1];- const thirdResponse = store.getActions()[2];expect(firstResponse.type).toEqual(INIT_SECOND_LAYER_GROUP);- expect(secondResponse.type).toEqual(INIT_SECOND_DATE);- expect(thirdResponse.type).toEqual(CONSTANTS.TOGGLE_ON_OFF);+ expect(secondResponse.type).toEqual(CONSTANTS.TOGGLE_ON_OFF);});test(diff --git a/web/js/modules/date/actions.js b/web/js/modules/date/actions.jsindex dc7d614a2..c89024c13 100644--- a/web/js/modules/date/actions.js+++ b/web/js/modules/date/actions.js@@ -5,7 +5,6 @@ import {SELECT_DATE,UPDATE_APP_NOW,TOGGLE_CUSTOM_MODAL,- INIT_SECOND_DATE,ARROW_DOWN,ARROW_UP,SET_PRELOAD,@@ -49,11 +48,6 @@ export function updateAppNow(date) {value: date,};}-export function initSecondDate() {- return {- type: INIT_SECOND_DATE,- };-}export function selectDate(date) {return (dispatch, getState) => {const state = getState();diff --git a/web/js/modules/date/constants.js b/web/js/modules/date/constants.jsindex af5a27350..9fb2214ce 100644--- a/web/js/modules/date/constants.js+++ b/web/js/modules/date/constants.js@@ -4,7 +4,6 @@ export const CHANGE_TIME_SCALE = 'DATE/CHANGE_TIME_SCALE';export const SELECT_DATE = 'DATE/SELECT_DATE';export const UPDATE_APP_NOW = 'DATE/UPDATE_APP_NOW';export const TOGGLE_CUSTOM_MODAL = 'DATE/TOGGLE_CUSTOM_MODAL';-export const INIT_SECOND_DATE = 'DATE/INIT_SECOND_DATE';export const ARROW_DOWN = 'DATE/ARROW_DOWN';export const ARROW_UP = 'DATE/ARROW_UP';export const SET_PRELOAD = 'DATE/SET_PRELOAD';diff --git a/web/js/modules/date/reducers.js b/web/js/modules/date/reducers.jsindex eb93bf56c..658879365 100644--- a/web/js/modules/date/reducers.js+++ b/web/js/modules/date/reducers.js@@ -6,7 +6,6 @@ import {UPDATE_APP_NOW,TOGGLE_CUSTOM_MODAL,customModalType,- INIT_SECOND_DATE,ARROW_DOWN,ARROW_UP,SET_PRELOAD,@@ -46,11 +45,6 @@ export function dateReducer(state = dateReducerState, action) {...state,selectedZoom: action.value,};- case INIT_SECOND_DATE:- return {- ...state,- selectedB: util.dateAdd(state.selected, 'day', -7),- };case CHANGE_CUSTOM_INTERVAL:return {...state,