From 34ea7856d6a75fba420bf379656dc3c8a7018948 Mon Sep 17 00:00:00 2001 From: Maxwell Barvian Date: Sun, 5 Jan 2025 21:02:13 -0800 Subject: [PATCH] Add missing symbol part to SSR --- .changeset/tiny-schools-press.md | 8 ++++++++ packages/number-flow/src/ssr.ts | 2 +- test-suites/wrapper/render.test.ts | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/tiny-schools-press.md diff --git a/.changeset/tiny-schools-press.md b/.changeset/tiny-schools-press.md new file mode 100644 index 00000000..6a29ef2e --- /dev/null +++ b/.changeset/tiny-schools-press.md @@ -0,0 +1,8 @@ +--- +'number-flow': patch +'@number-flow/react': patch +'@number-flow/svelte': patch +'@number-flow/vue': patch +--- + +Add missing symbol part to SSR diff --git a/packages/number-flow/src/ssr.ts b/packages/number-flow/src/ssr.ts index 6fa604eb..961c22c5 100644 --- a/packages/number-flow/src/ssr.ts +++ b/packages/number-flow/src/ssr.ts @@ -34,7 +34,7 @@ const styles = css` ` const renderPart = (part: KeyedNumberPart) => - `${part.value}` + `${part.value}` const renderSection = (section: KeyedNumberPart[], part: string) => `${section.reduce((str, p) => str + renderPart(p), '')}` diff --git a/test-suites/wrapper/render.test.ts b/test-suites/wrapper/render.test.ts index bd254439..48b4088d 100644 --- a/test-suites/wrapper/render.test.ts +++ b/test-suites/wrapper/render.test.ts @@ -15,6 +15,7 @@ test('renders correctly', async ({ page }) => { // Check for parts await expect(flow.locator('[part~=left]')).toBeAttached() await expect(flow.locator('[part~=currency]')).toBeAttached() + await expect(flow.locator('[part~=symbol]')).toHaveCount(4) await expect(flow.locator('[part~=number]')).toBeAttached() await expect(flow.locator('[part~=integer]')).toBeAttached() await expect(flow.locator('[part~=fraction]')).toBeAttached()