-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Robert Schüler
committed
Jun 14, 2024
1 parent
25fad18
commit 10afcae
Showing
2 changed files
with
46 additions
and
6 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
new/src/components/Scenarios/__test__/ScenarioCase.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { render, screen } from "@testing-library/react"; | ||
import { ScenarioCase } from "../ScenarioCase"; | ||
import { createScenarioCaseModel, createStepModel, createWord } from "./scenarioTestData"; | ||
|
||
describe("ScenarioCase", () => { | ||
it("should display class name", () => { | ||
const className = "name.of.my.class"; | ||
render(<ScenarioCase className={className} scenarioCase={createScenarioCaseModel()} />); | ||
|
||
expect(screen.getByText(className)).toBeInTheDocument(); | ||
}); | ||
|
||
it("should display all scenario steps", () => { | ||
const singleWordScenarioDescriptions = ["marine", "debug", "grind", "trivial", "timetable"]; | ||
|
||
const steps = singleWordScenarioDescriptions.map(description => | ||
createStepModel({ words: [createWord({ value: description })] }) | ||
); | ||
|
||
render(<ScenarioCase className={""} scenarioCase={createScenarioCaseModel({ steps })} />); | ||
|
||
singleWordScenarioDescriptions.forEach(description => { | ||
expect(screen.getByText(description)).toBeVisible(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters