From cd1628e73f0bf3716490a2b5c95c85b6fb0736a6 Mon Sep 17 00:00:00 2001 From: Julien BIANCHI Date: Sun, 18 Oct 2026 19:33:08 +0200 Subject: [PATCH 1/3] test: bring the component test fixtures up to date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three of the component tests written for node:test built their commits and users before fields they now need: the thread test lacked preview_segments, so FoldedCommitBody had nothing to map; the images test's user lacked timezone; the inbox test's commit lacked hot_score, mentions and pasteis_count. None of this showed, because these tests run nowhere yet. The fixtures now carry the fields, so the next commit can make them run and type-check. 🤖 Generated with Claude Code --- tests/Unit/CommitImages.test.tsx | 1 + tests/Unit/CommitThread.test.tsx | 1 + tests/Unit/NotificationInbox.test.tsx | 3 +++ 3 files changed, 5 insertions(+) diff --git a/tests/Unit/CommitImages.test.tsx b/tests/Unit/CommitImages.test.tsx index 95a82763fd..409adc14dc 100644 --- a/tests/Unit/CommitImages.test.tsx +++ b/tests/Unit/CommitImages.test.tsx @@ -37,6 +37,7 @@ const commit: Commit = { has_sponsors_listing: false, has_github_account: true, lane: 0, + timezone: null, created_at: '2026-10-16T10:00:00Z', updated_at: '2026-10-16T10:00:00Z', }, diff --git a/tests/Unit/CommitThread.test.tsx b/tests/Unit/CommitThread.test.tsx index 4467068f63..475b14b8da 100644 --- a/tests/Unit/CommitThread.test.tsx +++ b/tests/Unit/CommitThread.test.tsx @@ -21,6 +21,7 @@ const reply = (id: string): Commit => created_at: new Date().toISOString(), status: 'approved', body_segments: [{ type: 'text', text: `Visible reply ${id}` }], + preview_segments: null, replies_count: 0, user: { id: 'author', name: 'Author', username: 'author', lane: 1, timezone: null }, }) as Commit; diff --git a/tests/Unit/NotificationInbox.test.tsx b/tests/Unit/NotificationInbox.test.tsx index 56b001483b..c4d3f0faf6 100644 --- a/tests/Unit/NotificationInbox.test.tsx +++ b/tests/Unit/NotificationInbox.test.tsx @@ -46,12 +46,15 @@ const quote: NotificationGroup = { user_id: actor.id, parent_id: null, body: 'My quote commentary', + mentions: {}, body_segments: [{ type: 'text', text: 'My quote commentary' }], preview_segments: null, status: 'approved', created_at: timestamp, updated_at: timestamp, + hot_score: 0, stars_count: 0, + pasteis_count: 0, starred: false, quoted_commit_id: 'quoted-commit', }, From 8721af1d6ccaabf6cfc53ef127be5f7fde167b6c Mon Sep 17 00:00:00 2001 From: Julien BIANCHI Date: Sun, 18 Oct 2026 19:35:21 +0200 Subject: [PATCH 2/3] test: run the component tests written for node:test under the Vite runner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ten component tests import test from node:test and contain JSX. The test:unit script runs node --test over tests/Unit/*.test.ts, which neither matches .tsx files nor parses JSX, so they have run nowhere since the day they were written, and only bun test, which is not the project's runner, could execute them. The seven other .tsx tests already run under the Vite runner, listed by name in the config that SeriesStash.test.ts launches from node --test. These ten now import test from vite-plus/test, and lose the void before their test() calls, which Vitest's test() returning nothing made meaningless and the linter flagged one by one. Both the Vite config and the tests tsconfig take every .tsx test by glob, so nothing has to be registered by hand again. The Vite run goes from 7 files and 36 cases to 17 files and 119, all green after the previous commit's fixtures, and tsc now covers all seventeen. The formatter was run over the touched files to sort their imports. 🤖 Generated with Claude Code --- tests/Unit/CommitImages.test.tsx | 12 ++++++------ tests/Unit/CommitQuoteButton.test.tsx | 4 ++-- tests/Unit/CommitStarButton.test.tsx | 12 ++++++------ tests/Unit/CommitThread.test.tsx | 12 +++++++++--- tests/Unit/ComposerPreview.test.tsx | 26 +++++++++++++------------- tests/Unit/LinkifiedText.test.tsx | 26 +++++++++++++------------- tests/Unit/NotificationInbox.test.tsx | 22 +++++++++------------- tests/Unit/NotificationIndex.test.tsx | 6 +++--- tests/Unit/QuotedCommit.test.tsx | 14 +++++++------- tests/Unit/SecretWarning.test.tsx | 8 ++++---- tests/draft-images.config.ts | 10 +--------- tests/tsconfig.json | 3 +-- 12 files changed, 74 insertions(+), 81 deletions(-) diff --git a/tests/Unit/CommitImages.test.tsx b/tests/Unit/CommitImages.test.tsx index 409adc14dc..c6d6329429 100644 --- a/tests/Unit/CommitImages.test.tsx +++ b/tests/Unit/CommitImages.test.tsx @@ -1,7 +1,7 @@ /// import assert from 'node:assert/strict'; -import { test } from 'node:test'; import { renderToStaticMarkup } from 'react-dom/server'; +import { test } from 'vite-plus/test'; import { CommitImages, replaceFailedImage, @@ -52,7 +52,7 @@ const commit: Commit = { ], }; -void test('keeps the uploaded image until it fails to load', () => { +test('keeps the uploaded image until it fails to load', () => { assert.ok( renderToStaticMarkup().includes( 'src="/images/missing.webp"', @@ -60,7 +60,7 @@ void test('keeps the uploaded image until it fails to load', () => { ); }); -void test('shows the short image hash instead of the alt text while the image loads', () => { +test('shows the short image hash instead of the alt text while the image loads', () => { const markup = renderToStaticMarkup(); const placeholder = markup.match( /