diff --git a/frontend/src/components/Tooltip.tsx b/frontend/src/components/Tooltip.tsx index 758e6a4..1b8b6c8 100644 --- a/frontend/src/components/Tooltip.tsx +++ b/frontend/src/components/Tooltip.tsx @@ -1,5 +1,5 @@ -import {IconDefinition} from "@fortawesome/free-solid-svg-icons"; -import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; +import { IconDefinition } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; export function IconButton({ icon, diff --git a/frontend/src/components/Welcome.test.tsx b/frontend/src/components/Welcome.test.tsx index fb39d3a..4768396 100644 --- a/frontend/src/components/Welcome.test.tsx +++ b/frontend/src/components/Welcome.test.tsx @@ -1,28 +1,27 @@ -import { render, screen } from "@testing-library/react" -import { describe, expect,it } from "vitest" -import { vi } from "vitest" - +import { render, screen } from "@testing-library/react"; +import { describe, expect, it } from "vitest"; +import { vi } from "vitest"; vi.mock("../../wailsjs/go/dispatcher/Service", () => ({ - Dispatch: vi.fn().mockResolvedValue(undefined) + Dispatch: vi.fn().mockResolvedValue(undefined), })); -import userEvent from "@testing-library/user-event" +import userEvent from "@testing-library/user-event"; -import {Dispatch} from "../../wailsjs/go/dispatcher/Service"; -import {Command} from "../App"; -import Welcome from "./Welcome" +import { Dispatch } from "../../wailsjs/go/dispatcher/Service"; +import { Command } from "../App"; +import Welcome from "./Welcome"; describe("Welcome", () => { it("renders the Create New Split File button", async () => { - render() + render(); const button = screen.getByRole("button", { - name: /create new split file/i - }) + name: /create new split file/i, + }); - expect(button).toBeInTheDocument() - await userEvent.click(button) - expect(Dispatch).toHaveBeenCalledExactlyOnceWith(Command.NEW, null) - }) -}) + expect(button).toBeInTheDocument(); + await userEvent.click(button); + expect(Dispatch).toHaveBeenCalledExactlyOnceWith(Command.NEW, null); + }); +}); diff --git a/frontend/src/components/Welcome.tsx b/frontend/src/components/Welcome.tsx index f4354c4..49b963f 100644 --- a/frontend/src/components/Welcome.tsx +++ b/frontend/src/components/Welcome.tsx @@ -41,16 +41,6 @@ export default function Welcome() { Exit OpenSplit - -

Copyright ZellyDev LLC - ZellyDev Games {new Date().getFullYear()}

diff --git a/frontend/src/components/editor/SplitEditor.tsx b/frontend/src/components/editor/SplitEditor.tsx index ac84e3a..8cc0349 100644 --- a/frontend/src/components/editor/SplitEditor.tsx +++ b/frontend/src/components/editor/SplitEditor.tsx @@ -13,9 +13,9 @@ import { WindowCenter, WindowSetSize } from "../../../wailsjs/runtime"; import { Command } from "../../App"; import SegmentPayload from "../../models/segmentPayload"; import SplitFilePayload from "../../models/splitFilePayload"; -import {TimeRow} from "./TimeRow"; -import {colorFromId, GroupCtx} from "./hashColor"; -import {IconButton} from "../Tooltip"; +import { IconButton } from "../Tooltip"; +import { colorFromId, GroupCtx } from "./hashColor"; +import { TimeRow } from "./TimeRow"; type SplitEditorParams = { splitFilePayload: SplitFilePayload | null; @@ -290,7 +290,7 @@ export default function SplitEditor({ splitFilePayload }: SplitEditorParams) { const nextInheritedGroup = ownGroup ?? null; const nextIsDirectChild = !!ownGroup; - const frag = ( + const frag = ( @@ -328,20 +328,10 @@ export default function SplitEditor({ splitFilePayload }: SplitEditorParams) { - {!hasChildren && ( - - )} + {!hasChildren && } - - {!hasChildren && ( - - )} - + {!hasChildren && } addSegment(segment)} /> @@ -362,7 +352,7 @@ export default function SplitEditor({ splitFilePayload }: SplitEditorParams) { ); if (!hasChildren) { - totalAvg += segment.average + totalAvg += segment.average; totalBest += segment.pb; } return frag; diff --git a/frontend/src/components/editor/TimeRow.tsx b/frontend/src/components/editor/TimeRow.tsx index e0eec24..acf4f00 100644 --- a/frontend/src/components/editor/TimeRow.tsx +++ b/frontend/src/components/editor/TimeRow.tsx @@ -1,5 +1,6 @@ -import {msToParts, numeric, partsToMS, TimeParts} from "../splitter/Timer"; -import {forwardRef, RefObject, useImperativeHandle, useRef} from "react"; +import { forwardRef, RefObject, useImperativeHandle, useRef } from "react"; + +import { msToParts, partsToMS } from "../splitter/Timer"; type timeRowParams = { time: number | null; @@ -9,12 +10,11 @@ type Handle = { getMillis(): number; }; -export const TimeRow = forwardRef( - (props, ref) => { - const hourRef: RefObject = useRef(null) - const minuteRef: RefObject = useRef(null) - const secondRef: RefObject = useRef(null) - const centiRef: RefObject = useRef(null) +export const TimeRow = forwardRef((props, ref) => { + const hourRef: RefObject = useRef(null); + const minuteRef: RefObject = useRef(null); + const secondRef: RefObject = useRef(null); + const centiRef: RefObject = useRef(null); useImperativeHandle(ref, () => ({ getMillis: () => { @@ -24,17 +24,13 @@ export const TimeRow = forwardRef( minutes: parseInt(minuteRef.current?.value ?? "0", 10), seconds: parseInt(secondRef.current?.value ?? "0", 10), centis: parseInt(centiRef.current?.value ?? "0", 10), - }) - } - })) + }); + }, + })); return (
- + : ({ EventsOn: vi.fn(), @@ -8,4 +8,4 @@ vi.mock("../../wailsjs/runtime/runtime", () => ({ EventsEmit: vi.fn(), WindowSetTitle: vi.fn(), WindowSetSize: vi.fn(), -})) +})); diff --git a/frontend/vite.config.js b/frontend/vite.config.js index d7ac4d5..5057f65 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -7,6 +7,6 @@ export default defineConfig({ test: { environment: "jsdom", setupFiles: "./src/test/setupTests.ts", - globals: true - } + globals: true, + }, });