From e330329ac2848f6cf8ff91485831b802c50cf045 Mon Sep 17 00:00:00 2001 From: high1 Date: Thu, 29 Jan 2026 14:26:16 +0100 Subject: [PATCH] fix(test): Clock face unmount, cleanup --- src/ClockFace.tsx | 4 +++- test/ClockFace.test.tsx | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ClockFace.tsx b/src/ClockFace.tsx index eda23b5..895abdd 100644 --- a/src/ClockFace.tsx +++ b/src/ClockFace.tsx @@ -2,10 +2,12 @@ import { ClockHands } from '@/ClockHands'; import { Graduations } from '@/Graduations'; import { getTestId } from '@/utilities'; +export const clockFaceId = 'clock-face'; + export const ClockFace = () => (
diff --git a/test/ClockFace.test.tsx b/test/ClockFace.test.tsx index 0435cf8..4effb1c 100644 --- a/test/ClockFace.test.tsx +++ b/test/ClockFace.test.tsx @@ -1,15 +1,16 @@ import { describe, expect, test } from 'vitest'; import { render } from 'vitest-browser-solid'; -import { ClockFace } from '@/ClockFace'; +import { ClockFace, clockFaceId } from '@/ClockFace'; describe('', () => { test('renders clock face', () => { const screen = render(() => ); - expect(screen.getByTestId('clock-face')).toBeInTheDocument(); + expect(screen.getByTestId(clockFaceId)).toBeInTheDocument(); }); test('unmount clock face', () => { - const { unmount } = render(() => ); - unmount(); + const screen = render(() => ); + screen.unmount(); + expect(screen.getByTestId(clockFaceId)).not.toBeInTheDocument(); }); });