Skip to content

Commit

Permalink
Final unit test for the branch
Browse files Browse the repository at this point in the history
  • Loading branch information
bduhbya committed Jun 30, 2024
1 parent be1d5b5 commit 660643d
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/app/components/CombatTracker.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,30 @@ describe("CombatTracker", () => {
expectedActiveCharacterIndex[i],
getByTestId,
);
act(() => fireEvent.click(moveUpButton)); // Move the active character down
act(() => fireEvent.click(moveUpButton)); // Move the active character up
}
});

it("handles duplicate character name", async () => {
const { getByText, queryAllByText } = render(<CombatTracker />);
await addCharacterAndCheck(
mockSingleCharacterWarriorFile,
1,
getByText,
queryAllByText,
);

await addCharacterAndCheck(
mockSingleCharacterWarriorFile,
2,
getByText,
queryAllByText,
);
});

// TODO: add test for removing character
// TODO: add test for editing character
// TODO: add test for selecting character
// Helper functions

async function checkActiveCharacterIndex(
Expand Down

0 comments on commit 660643d

Please sign in to comment.