diff --git a/packages/page-typing-test/lib/TypingTestPage.test.tsx b/packages/page-typing-test/lib/TypingTestPage.test.tsx index 965e9239d..d3dd2e356 100644 --- a/packages/page-typing-test/lib/TypingTestPage.test.tsx +++ b/packages/page-typing-test/lib/TypingTestPage.test.tsx @@ -4,10 +4,10 @@ import { KeyboardProvider } from "@keybr/keyboard"; import { FakePhoneticModel } from "@keybr/phonetic-model"; import { PhoneticModelLoader } from "@keybr/phonetic-model-loader"; import { FakeSettingsContext } from "@keybr/settings"; -import { fireEvent, render } from "@testing-library/react"; +import { render } from "@testing-library/react"; import { TypingTestPage } from "./TypingTestPage.tsx"; -test("render", async () => { +test("render", () => { PhoneticModelLoader.loader = FakePhoneticModel.loader; const r = render( @@ -20,8 +20,5 @@ test("render", async () => { , ); - fireEvent.click(await r.findByTitle("Settings", { exact: false })); - fireEvent.click(await r.findByTitle("Save settings", { exact: false })); - r.unmount(); }); diff --git a/packages/page-typing-test/lib/components/LineTemplate.module.less b/packages/page-typing-test/lib/components/LineTemplate.module.less index 299512952..37d9388bf 100644 --- a/packages/page-typing-test/lib/components/LineTemplate.module.less +++ b/packages/page-typing-test/lib/components/LineTemplate.module.less @@ -1,13 +1,3 @@ .line { - display: flex; - align-items: center; border-block-end: var(--separator-border); } - -.text { - flex: auto; -} - -.stats { - text-align: end; -} diff --git a/packages/page-typing-test/lib/components/LineTemplate.tsx b/packages/page-typing-test/lib/components/LineTemplate.tsx index 8ddac5e1d..0378db782 100644 --- a/packages/page-typing-test/lib/components/LineTemplate.tsx +++ b/packages/page-typing-test/lib/components/LineTemplate.tsx @@ -1,6 +1,5 @@ -import { formatDuration, Value } from "@keybr/widget"; import { memo, type ReactNode } from "react"; -import { type Progress, type SessionLine } from "../session/index.ts"; +import { type SessionLine } from "../session/index.ts"; import * as styles from "./LineTemplate.module.less"; export const LineTemplate = memo(function LineTemplate({ @@ -8,26 +7,6 @@ export const LineTemplate = memo(function LineTemplate({ progress, }: { readonly children: ReactNode; -} & SessionLine): ReactNode { - return ( -
-
{children}
-
{progress && }
-
- ); +} & SessionLine) { + return
{children}
; }); - -function Stats({ length, time, progress }: Progress): ReactNode { - return ( - <> - - {" / "} - - {" / "} - - - ); -} diff --git a/packages/page-typing-test/lib/components/Replay.tsx b/packages/page-typing-test/lib/components/Replay.tsx index 487d54395..2a859cd7d 100644 --- a/packages/page-typing-test/lib/components/Replay.tsx +++ b/packages/page-typing-test/lib/components/Replay.tsx @@ -12,8 +12,8 @@ import { Box, useDocumentVisibility } from "@keybr/widget"; import { type ReactNode, useEffect, useMemo, useState } from "react"; import { ReplayState, Session, type TestResult } from "../session/index.ts"; import { useCompositeSettings } from "../settings.ts"; -import { Progress } from "./Progress.tsx"; import * as styles from "./Replay.module.less"; +import { ReplayProgress } from "./ReplayProgress.tsx"; export function Replay({ result: { steps, events }, @@ -29,7 +29,7 @@ export function Replay({ ); return (
- + diff --git a/packages/page-typing-test/lib/components/Progress.tsx b/packages/page-typing-test/lib/components/ReplayProgress.tsx similarity index 84% rename from packages/page-typing-test/lib/components/Progress.tsx rename to packages/page-typing-test/lib/components/ReplayProgress.tsx index b248944b6..0af598331 100644 --- a/packages/page-typing-test/lib/components/Progress.tsx +++ b/packages/page-typing-test/lib/components/ReplayProgress.tsx @@ -8,9 +8,9 @@ import { import { useEffect, useState } from "react"; import { type ReplayState } from "../session/index.ts"; -export function Progress({ stepper }: { readonly stepper: ReplayState }) { +export function ReplayProgress({ stepper }: { readonly stepper: ReplayState }) { const { formatSpeed } = useFormatter(); - const { progress, time } = useProgress(stepper); + const { progress, time } = useReplayProgress(stepper); return ( { diff --git a/packages/page-typing-test/lib/components/ReportScreen.tsx b/packages/page-typing-test/lib/components/ReportScreen.tsx index 57d4f97bb..c01435da6 100644 --- a/packages/page-typing-test/lib/components/ReportScreen.tsx +++ b/packages/page-typing-test/lib/components/ReportScreen.tsx @@ -137,7 +137,6 @@ export function ReportScreen({ result }: { readonly result: TestResult }) {