Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

add reducer tests

Ed Platob34918f0b190
diff --git a/web/js/modules/alerts/reducer.test.js b/web/js/modules/alerts/reducer.test.js
index 2d9785226..fec093471 100644
--- a/web/js/modules/alerts/reducer.test.js
+++ b/web/js/modules/alerts/reducer.test.js
@@ -1,5 +1,10 @@
import { alertReducer, defaultAlertState } from './reducer';
-import { ACTIVATE_VECTOR_ZOOM_ALERT, DISABLE_VECTOR_ZOOM_ALERT } from './constants';
+import {
+ DISABLE_VECTOR_ZOOM_ALERT,
+ ACTIVATE_VECTOR_ZOOM_ALERT,
+ DISABLE_VECTOR_EXCEEDED_ALERT,
+ ACTIVATE_VECTOR_EXCEEDED_ALERT,
+} from './constants';
describe('alertReducer', () => {
test('should return the initial state', () => {
@@ -7,7 +12,7 @@ describe('alertReducer', () => {
defaultAlertState,
);
});
- test('DISABLE_VECTOR_ZOOM_ALERT should disable vector alert state', () => {
+ test('DISABLE_VECTOR_ZOOM_ALERT should disable vector zoom alert state', () => {
expect(alertReducer(
{ ...defaultAlertState, isVectorZoomAlertPresent: true },
{ type: DISABLE_VECTOR_ZOOM_ALERT },
@@ -15,9 +20,22 @@ describe('alertReducer', () => {
defaultAlertState,
);
});
- test('ACTIVATE_VECTOR_ZOOM_ALERT should enable vector alert state', () => {
- const vectorEnabledState = { ...defaultAlertState, isVectorZoomAlertPresent: true };
+ test('ACTIVATE_VECTOR_ZOOM_ALERT should enable vector zoom alert state', () => {
+ const vectorZoomEnabledState = { ...defaultAlertState, isVectorZoomAlertPresent: true };
expect(alertReducer(undefined,
- { type: ACTIVATE_VECTOR_ZOOM_ALERT })).toEqual(vectorEnabledState);
+ { type: ACTIVATE_VECTOR_ZOOM_ALERT })).toEqual(vectorZoomEnabledState);
+ });
+ test('DISABLE_VECTOR_EXCEEDED_ALERT should disable vector exceeded results alert state', () => {
+ expect(alertReducer(
+ { ...defaultAlertState, isVectorExceededAlertPresent: true },
+ { type: DISABLE_VECTOR_EXCEEDED_ALERT },
+ )).toEqual(
+ defaultAlertState,
+ );
+ });
+ test('ACTIVATE_VECTOR_EXCEEDED_ALERT should enable vector exceeded results alert state', () => {
+ const vectorExceededEnabledState = { ...defaultAlertState, isVectorExceededAlertPresent: true };
+ expect(alertReducer(undefined,
+ { type: ACTIVATE_VECTOR_EXCEEDED_ALERT })).toEqual(vectorExceededEnabledState);
});
});