From 6bdcd3a8b874982729f42daf7bcdbb3f8631f094 Mon Sep 17 00:00:00 2001 From: mmtr <1233880+mmtr@users.noreply.github.com> Date: Fri, 21 Aug 2026 14:22:27 +0200 Subject: [PATCH 1/2] Tests: End the About CSS slice at the next section, not a named one The About theme contract test sliced os-settings.css between the About tab comment and "Apps & Icons section". #640 renamed that section while #631 was in flight, so the end index came back -1 and the slice was empty. One assertion failed on the empty slice; the rest of the file's assertions had nothing to inspect. Take the next top-level section comment instead, so a rename downstream of About cannot silently empty the slice again. Co-Authored-By: Claude Opus 5 --- tests/vitest/os-settings-about-theme.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/vitest/os-settings-about-theme.test.ts b/tests/vitest/os-settings-about-theme.test.ts index 6e71e864..d1415e91 100644 --- a/tests/vitest/os-settings-about-theme.test.ts +++ b/tests/vitest/os-settings-about-theme.test.ts @@ -14,7 +14,13 @@ import { describe, expect, test } from 'vitest'; const root = join( __dirname, '../..' ); const css = readFileSync( join( root, 'assets/css/os-settings.css' ), 'utf8' ); const aboutStart = css.indexOf( '/*\n * About tab' ); -const aboutEnd = css.indexOf( '/* Apps & Icons section', aboutStart ); +// The About block runs until the next top-level section comment. Naming +// the section that follows is what broke this test: it pointed at +// "Apps & Icons section", which #640 renamed while this file was in +// flight, so the slice came back empty and the assertions below passed +// over nothing. Whatever sits after About can be renamed again. +const nextSection = css.indexOf( '\n/*', aboutStart + 1 ); +const aboutEnd = -1 === nextSection ? css.length : nextSection; const aboutCss = css.slice( aboutStart, aboutEnd ); describe( 'OS Settings — About theme contract', () => { From 0c4201f6f35689969d16fb816e2f756477e458f8 Mon Sep 17 00:00:00 2001 From: Miguel Torres <1233880+mmtr@users.noreply.github.com> Date: Fri, 21 Aug 2026 14:26:52 +0200 Subject: [PATCH 2/2] Update os-settings-about-theme.test.ts --- tests/vitest/os-settings-about-theme.test.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/vitest/os-settings-about-theme.test.ts b/tests/vitest/os-settings-about-theme.test.ts index d1415e91..73d5b85b 100644 --- a/tests/vitest/os-settings-about-theme.test.ts +++ b/tests/vitest/os-settings-about-theme.test.ts @@ -14,11 +14,6 @@ import { describe, expect, test } from 'vitest'; const root = join( __dirname, '../..' ); const css = readFileSync( join( root, 'assets/css/os-settings.css' ), 'utf8' ); const aboutStart = css.indexOf( '/*\n * About tab' ); -// The About block runs until the next top-level section comment. Naming -// the section that follows is what broke this test: it pointed at -// "Apps & Icons section", which #640 renamed while this file was in -// flight, so the slice came back empty and the assertions below passed -// over nothing. Whatever sits after About can be renamed again. const nextSection = css.indexOf( '\n/*', aboutStart + 1 ); const aboutEnd = -1 === nextSection ? css.length : nextSection; const aboutCss = css.slice( aboutStart, aboutEnd );