From 69f90df5719407c3d4556cf973cfcfd61688ea70 Mon Sep 17 00:00:00 2001 From: Knotty Wyvern Date: Tue, 27 Oct 2026 20:58:55 -0700 Subject: [PATCH] Move the smoke tests onto the shared harness Each smoke test now uses tests/smoke/_harness/ for Playwright, the Tauri IPC mock, the in-memory workspace, and output folders, instead of its own copy. The tests keep their interactions and assertions. Mock handlers that the app never calls are gone. - Split the four mixed regression scripts into 18 feature tests. - Update tests that broke when the app changed on purpose. Each update cites the app source that shows the new behavior. - Mark two real app defects with @known-issue: the settings window controls are 1px shorter than the main window controls, and plugin tabs cannot be reordered by dragging without a workspace. - Merge three palette unit tests into one table-driven test. - The native tests load Playwright through the harness and read NATIVE_CDP_URL, with their old variable names as fallbacks. - A failed smoke test saves a screenshot and prints the console errors. - The runner runs failed tests once more, alone, and reports a test that then passes as flaky. Result: 89 passed, 1 flaky, 2 known issues, 0 failed. Before, 45 of 78 passed. --- CLAUDE.md | 8 +- docs/builds.md | 15 +- docs/development.md | 68 +-- scripts/smoke.mjs | 47 +- tests/native/browser.native.mjs | 18 +- tests/native/menuScope.native.mjs | 24 +- tests/native/spelling.native.mjs | 27 +- .../tabTransferAndThemeExport.native.mjs | 11 +- tests/native/treeRename.native.mjs | 29 +- tests/smoke/_harness/index.mjs | 24 +- .../appearance/backgroundFrames.smoke.mjs | 115 +++-- .../appearance/backgroundImages.smoke.mjs | 162 +++---- .../appearance/backgroundLayout.smoke.mjs | 67 ++- .../appearance/backgroundOverlay.smoke.mjs | 51 +-- .../appearance/characterThemes.smoke.mjs | 265 ++++++----- .../smoke/appearance/colorThemeMenu.smoke.mjs | 43 ++ tests/smoke/appearance/density.smoke.mjs | 167 ++++--- .../appearance/newTabBackground.smoke.mjs | 49 ++ tests/smoke/appearance/palettes.smoke.mjs | 352 +++++++-------- tests/smoke/appearance/themeExport.smoke.mjs | 31 ++ tests/smoke/appearance/themeImport.smoke.mjs | 33 ++ .../smoke/appearance/themeVariants.smoke.mjs | 132 +++--- .../appearance/tooltipPlacement.smoke.mjs | 53 +++ .../appearance/tooltipsAndSelection.smoke.mjs | 274 +++++------- tests/smoke/appearance/typography.smoke.mjs | 98 ++-- tests/smoke/browser/blankPage.smoke.mjs | 61 +++ tests/smoke/browser/builtin.smoke.mjs | 201 ++++----- tests/smoke/browser/fields.smoke.mjs | 296 +++++++------ tests/smoke/browser/interaction.smoke.mjs | 355 ++++++++------- tests/smoke/browser/settingsMenus.smoke.mjs | 89 ++-- tests/smoke/browser/webData.smoke.mjs | 403 ++++++++--------- tests/smoke/editor/checklistEntry.smoke.mjs | 106 +---- tests/smoke/editor/codeBlocks.smoke.mjs | 106 ++--- tests/smoke/editor/dividers.smoke.mjs | 109 ++--- tests/smoke/editor/emptyMenu.smoke.mjs | 109 +---- tests/smoke/editor/footnotes.smoke.mjs | 310 ++++++------- tests/smoke/editor/imageNavigation.smoke.mjs | 180 +++----- tests/smoke/editor/images.smoke.mjs | 176 +++----- tests/smoke/editor/interactions.smoke.mjs | 97 ++-- tests/smoke/editor/markdownMenu.smoke.mjs | 158 +++---- tests/smoke/editor/markdownPaste.smoke.mjs | 90 +--- .../smoke/editor/modeSwitcherHover.smoke.mjs | 19 + tests/smoke/editor/pasteRepeat.smoke.mjs | 133 ++---- tests/smoke/editor/properties.smoke.mjs | 97 +--- tests/smoke/editor/selectionColor.smoke.mjs | 48 ++ tests/smoke/editor/surfaces.smoke.mjs | 88 ++-- .../smoke/editor/templatesAndTasks.smoke.mjs | 116 ++--- tests/smoke/editor/undoHistory.smoke.mjs | 133 ++---- tests/smoke/find/documentFind.smoke.mjs | 151 +++---- tests/smoke/find/pluginViews.smoke.mjs | 118 +++-- tests/smoke/find/searchPanel.smoke.mjs | 112 ++--- tests/smoke/layout/outline.smoke.mjs | 88 ++-- tests/smoke/layout/splits.smoke.mjs | 152 +++---- tests/smoke/layout/windowControls.smoke.mjs | 82 ++-- tests/smoke/layout/workbench.smoke.mjs | 282 ++++++------ tests/smoke/links/backlinks.smoke.mjs | 41 +- tests/smoke/links/fileDragLinks.smoke.mjs | 81 ++++ tests/smoke/links/linkEditing.smoke.mjs | 212 ++++----- tests/smoke/links/linkMenus.smoke.mjs | 141 +++--- tests/smoke/links/previewLinks.smoke.mjs | 102 ++--- tests/smoke/links/sectionLinks.smoke.mjs | 162 +++---- tests/smoke/links/workspaceLinks.smoke.mjs | 138 ++---- tests/smoke/menus/consistency.smoke.mjs | 132 +++--- tests/smoke/plugins/access.smoke.mjs | 236 +++++----- tests/smoke/plugins/choiceMenus.smoke.mjs | 39 +- tests/smoke/plugins/gitToolbar.smoke.mjs | 68 +++ tests/smoke/plugins/install.smoke.mjs | 417 ++++++++---------- tests/smoke/plugins/lifecycle.smoke.mjs | 361 +++++++-------- .../renameMarksAndTemplates.smoke.mjs | 165 ------- .../tooltipsAndBlankBrowser.smoke.mjs | 116 ----- .../treeDragLinksAndGitToolbar.smoke.mjs | 163 ------- .../workspaceShortcutsAndTemplates.smoke.mjs | 152 ------- tests/smoke/settings/density.smoke.mjs | 65 +-- .../smoke/settings/displayLanguage.smoke.mjs | 89 ++-- tests/smoke/settings/general.smoke.mjs | 127 +++--- tests/smoke/settings/titlebar.smoke.mjs | 113 +++-- tests/smoke/settings/window.smoke.mjs | 95 ++-- tests/smoke/tables/drag.smoke.mjs | 164 ++----- tests/smoke/tables/enterKey.smoke.mjs | 107 +---- tests/smoke/tables/formulas.smoke.mjs | 186 +++----- tests/smoke/tables/linkCaret.smoke.mjs | 146 +++--- tests/smoke/tables/navigation.smoke.mjs | 213 +++------ tests/smoke/tables/selection.smoke.mjs | 105 +---- tests/smoke/tabs/cycleShortcuts.smoke.mjs | 31 ++ .../smoke/tabs/lastTabAndSiteIcons.smoke.mjs | 212 ++++----- tests/smoke/tabs/lifecycle.smoke.mjs | 224 +++++----- tests/smoke/tabs/menus.smoke.mjs | 107 ++--- tests/smoke/tabs/ribbonDrop.smoke.mjs | 222 ++++------ tests/smoke/tabs/scroll.smoke.mjs | 216 ++++----- tests/smoke/tabs/transfer.smoke.mjs | 157 +++---- tests/smoke/tabs/windowTransfer.smoke.mjs | 56 +++ tests/smoke/tree/actions.smoke.mjs | 190 ++++---- tests/smoke/tree/folderActions.smoke.mjs | 38 ++ tests/smoke/tree/moveUndo.smoke.mjs | 45 ++ tests/smoke/tree/navigation.smoke.mjs | 126 +++--- tests/smoke/tree/newFiles.smoke.mjs | 141 +++--- tests/smoke/tree/renameMarks.smoke.mjs | 42 ++ tests/smoke/tree/renameSelection.smoke.mjs | 164 ++----- tests/smoke/tree/renameTitle.smoke.mjs | 273 +++++------- tests/smoke/tree/renameUndo.smoke.mjs | 187 ++++---- tests/smoke/tree/selection.smoke.mjs | 182 +++----- .../smoke/workspace/dialogDismissal.smoke.mjs | 26 ++ .../smoke/workspace/manageTemplates.smoke.mjs | 80 ++++ tests/smoke/workspace/openAndCreate.smoke.mjs | 106 ++--- .../smoke/workspace/saveAsTemplate.smoke.mjs | 35 ++ tests/unit/theme/asukaPalette.spec.ts | 44 -- tests/unit/theme/characterPalettes.spec.ts | 87 ++++ tests/unit/theme/malfoidPalette.spec.ts | 40 -- tests/unit/theme/themePalette.spec.ts | 40 -- 109 files changed, 5920 insertions(+), 7915 deletions(-) create mode 100644 tests/smoke/appearance/colorThemeMenu.smoke.mjs create mode 100644 tests/smoke/appearance/newTabBackground.smoke.mjs create mode 100644 tests/smoke/appearance/themeExport.smoke.mjs create mode 100644 tests/smoke/appearance/themeImport.smoke.mjs create mode 100644 tests/smoke/appearance/tooltipPlacement.smoke.mjs create mode 100644 tests/smoke/browser/blankPage.smoke.mjs create mode 100644 tests/smoke/editor/modeSwitcherHover.smoke.mjs create mode 100644 tests/smoke/editor/selectionColor.smoke.mjs create mode 100644 tests/smoke/links/fileDragLinks.smoke.mjs create mode 100644 tests/smoke/plugins/gitToolbar.smoke.mjs delete mode 100644 tests/smoke/regressions/renameMarksAndTemplates.smoke.mjs delete mode 100644 tests/smoke/regressions/tooltipsAndBlankBrowser.smoke.mjs delete mode 100644 tests/smoke/regressions/treeDragLinksAndGitToolbar.smoke.mjs delete mode 100644 tests/smoke/regressions/workspaceShortcutsAndTemplates.smoke.mjs create mode 100644 tests/smoke/tabs/cycleShortcuts.smoke.mjs create mode 100644 tests/smoke/tabs/windowTransfer.smoke.mjs create mode 100644 tests/smoke/tree/folderActions.smoke.mjs create mode 100644 tests/smoke/tree/moveUndo.smoke.mjs create mode 100644 tests/smoke/tree/renameMarks.smoke.mjs create mode 100644 tests/smoke/workspace/dialogDismissal.smoke.mjs create mode 100644 tests/smoke/workspace/manageTemplates.smoke.mjs create mode 100644 tests/smoke/workspace/saveAsTemplate.smoke.mjs delete mode 100644 tests/unit/theme/asukaPalette.spec.ts create mode 100644 tests/unit/theme/characterPalettes.spec.ts delete mode 100644 tests/unit/theme/malfoidPalette.spec.ts delete mode 100644 tests/unit/theme/themePalette.spec.ts diff --git a/CLAUDE.md b/CLAUDE.md index 7bfd29a..f92dd04 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -20,11 +20,11 @@ The [development guide](docs/development.md#architecture) maps the source folder | --- | --- | | `pnpm install --frozen-lockfile` | Install dependencies | | `pnpm tauri dev` | Run the desktop app with hot reload | -| `pnpm check` | Type checks | -| `pnpm test` | Unit tests (`scripts/*.spec.ts`) | +| `pnpm check` | Type checks of the app and the unit tests | +| `pnpm test` | Unit tests (`tests/unit/`) | | `cargo test --manifest-path src-tauri/Cargo.toml --lib` | Rust tests | | `pnpm check:menus` | Menu surface inventory | -| `node scripts/.smoke.mjs` | One browser smoke test. See [Browser smoke tests](docs/development.md#browser-smoke-tests). | +| `pnpm smoke [filter...]` | Browser smoke tests (`tests/smoke/`). See [Browser smoke tests](docs/development.md#browser-smoke-tests). | | `pnpm build:installer --version ` | Windows installer. See [Builds](docs/builds.md). | | `pnpm package:plugin [output-folder]` | Plugin ZIP | @@ -107,7 +107,7 @@ Rules from the owner: - A selection gets one outline around each group of adjacent selected items, with no borders on shared internal edges. - Colors follow the `ui-functional-color` skill and `docs/ui-color.md`: vivid by default, informative text opaque. - Before Review, check both themes, narrow windows, long lists, keyboard focus, and viewport edges. - For menu work, run `pnpm check:menus` and `tests/smoke/menus/consistency.smoke.mjs`. + For menu work, run `pnpm check:menus` and `pnpm smoke menus`. Keep screenshots of the exact control that the card names. - Record a rule change, a recurring problem, or an exception in `docs/design-decisions.md`. An isolated fix needs no entry. diff --git a/docs/builds.md b/docs/builds.md index 9919934..78776a2 100644 --- a/docs/builds.md +++ b/docs/builds.md @@ -31,7 +31,7 @@ Output: | File | Contents | | --- | --- | | `releases//RuneStone__x64-setup.exe` | The setup file to distribute | -| `releases//host.json` | The release version, the encoded toolchain and Windows versions, the path, the size in bytes, and the SHA-256 hash | +| `releases//host.json` | The release version, the encoded toolchain and Windows versions, the file name, the size in bytes, and the SHA-256 hash | The script prints `Installer available: ` when it completes. After a successful build, the version fields keep the new version. @@ -43,9 +43,9 @@ Example, from the 0.1.44 download link in the README: version `0.1.44` gives `re Source: `scripts/buildInstaller.mjs`. 1. Reads the version and makes sure that all version fields match the current version. -2. Makes sure that downgrade protection stays on in `tauri.conf.json` and `tauri.windows.conf.json`. +2. Makes sure that downgrade protection stays on in `tauri.conf.json` and `tauri.windows.conf.json`, and that the browser runtime is staged. 3. Stops if the setup file or `host.json` exists in the bundle folder or in `releases//`. -4. Saves copies of the four version files as `*.before` in `output/installer-build//`. +4. Saves copies of the four version files as `*.before` in `output/installer-build//