From 817e871f532ad8c8cf80390ef37a646d3b4a398d Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Sun, 15 Dec 2024 21:25:31 +0900 Subject: [PATCH] fix: tests --- src/internal/components/QrCode/gradientConstants.test.ts | 6 +++--- src/internal/components/QrCode/useCorners.test.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/internal/components/QrCode/gradientConstants.test.ts b/src/internal/components/QrCode/gradientConstants.test.ts index af5f1a2391..ec3209a522 100644 --- a/src/internal/components/QrCode/gradientConstants.test.ts +++ b/src/internal/components/QrCode/gradientConstants.test.ts @@ -93,9 +93,9 @@ describe('Preset Gradients', () => { const expectedPresets = ['default', 'blue', 'magenta', 'black']; for (const preset of expectedPresets) { - expect(presetGradients[preset]).toBeDefined(); - expect(Array.isArray(presetGradients[preset])).toBe(true); - expect(presetGradients[preset].length).toBe(3); + expect(presetGradients[preset as keyof typeof presetGradients]).toBeDefined(); + expect(Array.isArray(presetGradients[preset as keyof typeof presetGradients])).toBe(true); + expect(presetGradients[preset as keyof typeof presetGradients].length).toBe(3); } }); diff --git a/src/internal/components/QrCode/useCorners.test.tsx b/src/internal/components/QrCode/useCorners.test.tsx index e298993a74..4dc21063e4 100644 --- a/src/internal/components/QrCode/useCorners.test.tsx +++ b/src/internal/components/QrCode/useCorners.test.tsx @@ -29,10 +29,10 @@ describe('useCorners', () => { const children = svgGroup.props.children; expect(children).toHaveLength(6); - const rects = children.filter((child) => child.type === 'rect'); + const rects = children.filter((child: JSX.Element) => child.type === 'rect'); expect(rects).toHaveLength(3); - const circles = children.filter((child) => child.type === 'circle'); + const circles = children.filter((child: JSX.Element) => child.type === 'circle'); expect(circles).toHaveLength(3); });