Skip to content

Commit

Permalink
test: 임시 테스트 코드 작성 (CC-178)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunkkkk committed Aug 23, 2024
1 parent bf4cc54 commit fb0d5a0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Caecae/__tests__/FindGameTest/FindGameTest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { act } from "react";
import {
initFindingGameState,
action,
findingGameReducer,
} from "../../src/jobs/FindingGame/FindingGameWork";
import { Action } from "../../src/shared/Hyundux"
import createHynduxTester from "../../src/shared/Hyundux-test/Tester";

const tester = createHynduxTester(initFindingGameState, findingGameReducer);

test("changShowingAnswer__action_index_1__result_1_true", () => {
const givenData = initFindingGameState.payload;
const whenData: Action = action.changeShowingAnswer(1);
const thenData = tester.makeThenPayload({ answerIndex: 1 })

tester.given(givenData).when(whenData).then(thenData, true);
});

test("changShowingAnswer__action_index_2__result_1_false", () => {
const givenData = initFindingGameState.payload;
const whenData: Action = action.changeShowingAnswer(2);
const thenData = tester.makeThenPayload({ answerIndex: 1 })

tester.given(givenData).when(whenData).then(thenData, false);
});

0 comments on commit fb0d5a0

Please sign in to comment.