Skip to content

Commit 0257c79

Browse files
author
Shawn Toubeau
committed
adds menu reducer test
1 parent 9f29f11 commit 0257c79

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/reducers/mazeReducer/mazeReducer.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ describe("Maze Reducer Tests", () => {
230230
expect(updatedState).toEqual(expectedState);
231231
});
232232

233+
// TODO: stopVis
234+
233235
// TODO: randomizeWalls
234236

235237
it("Changes the size of the gird", () => {

src/reducers/menuReducer/menuReducer.spec.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
CHANGE_ALGO,
77
TOGGLE_MOVE_START,
88
TOGGLE_MOVE_END,
9+
CHANGE_SPEED,
910
} from "../../actions/menuActions/menuActions";
1011
import { initialState } from "../../models/menu/initialState";
1112
import { MenuState } from "../../models/menu";
@@ -92,5 +93,15 @@ describe("Menu Reducer Tests", () => {
9293
expect(updatedState).toEqual(expectedState);
9394
});
9495

95-
// TODO: changeSpeed
96+
it("Change Speed Expected State", () => {
97+
const action = {
98+
type: CHANGE_SPEED,
99+
payload: 1,
100+
};
101+
102+
const updatedState = menuReducer(initialState, action);
103+
const expectedState: MenuState = { ...initialState, currentSpeed: 1 };
104+
105+
expect(updatedState).toEqual(expectedState);
106+
});
96107
});

0 commit comments

Comments
 (0)