diff --git a/new/src/components/Scenarios/Scenario.tsx b/new/src/components/Scenarios/Scenario.tsx index 3fb1188a..c381604b 100644 --- a/new/src/components/Scenarios/Scenario.tsx +++ b/new/src/components/Scenarios/Scenario.tsx @@ -54,7 +54,7 @@ export function Scenario({ setExpanded(isExpansion); isExpansion ? onExpansionCallback() : onCollapsionCallback(); }, - [expanded, onExpansionCallback, onCollapsionCallback] + [onExpansionCallback, onCollapsionCallback] ); return ( diff --git a/new/src/components/Scenarios/ScenarioOverview.tsx b/new/src/components/Scenarios/ScenarioOverview.tsx index 7e535910..aa911ed1 100644 --- a/new/src/components/Scenarios/ScenarioOverview.tsx +++ b/new/src/components/Scenarios/ScenarioOverview.tsx @@ -19,7 +19,7 @@ export function ScenarioOverview(props: { description: string; }) { const [allExpanded, setAllExpanded] = useState(ExpansionState.COLLAPSED); - const {filter} = useFilters(); + const { filter } = useFilters(); const scenarios = repository.getAllScenarios(); return ( diff --git a/new/src/components/Scenarios/__test__/ScenarioStep.test.tsx b/new/src/components/Scenarios/__test__/ScenarioStep.test.tsx index a6d5e0e6..b2a669a2 100644 --- a/new/src/components/Scenarios/__test__/ScenarioStep.test.tsx +++ b/new/src/components/Scenarios/__test__/ScenarioStep.test.tsx @@ -1,4 +1,4 @@ -import { render, screen } from "@testing-library/react"; +import { render, screen, within } from "@testing-library/react"; import { createStepModel, createWord } from "./scenarioTestData"; import { ScenarioStep } from "../ScenarioStep"; @@ -51,7 +51,7 @@ describe("ScenarioStep", () => { /> ); - expect(screen.getByText(word).children[0]).toHaveTextContent(""); + expect(within(screen.getByText(word)).getByText("")).toBeInTheDocument(); } ); }); diff --git a/new/src/hooks/useFilters.ts b/new/src/hooks/useFilters.ts index dce2265e..24999502 100644 --- a/new/src/hooks/useFilters.ts +++ b/new/src/hooks/useFilters.ts @@ -5,11 +5,11 @@ export interface Filter { status: ScenarioStatusFilter | undefined; } -export function useFilters(): {filter: Filter, setUrlSearchParams: SetURLSearchParams} { +export function useFilters(): { filter: Filter; setUrlSearchParams: SetURLSearchParams } { const [searchParams, setSearchParams] = useSearchParams(); const status = searchParams.get("status"); - return {filter: { status: parseScenarioStatus(status) }, setUrlSearchParams: setSearchParams}; + return { filter: { status: parseScenarioStatus(status) }, setUrlSearchParams: setSearchParams }; } function parseScenarioStatus(status: string | null): ScenarioStatusFilter | undefined {