Skip to content

test(previews): accept localized save labels - #601

Merged
houko merged 3 commits into
mainfrom
fix/preview-test-locales
Nov 18, 2026
Merged

houko merged 3 commits into
mainfrom
fix/preview-test-locales

Conversation

@houko

@houko houko commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

The previews' demos say their words in the app's locale, which on a target is the machine's, but TestButtonSays and TestPickerWithoutHost searched only for the English Save/Saved labels, so ./examples/previews failed under -target macos on a Mac whose system language is Chinese.

  • TestButtonSays and TestPickerWithoutHost accept both translations, as TestButtonBusy already did.
  • The three save tests now run once in the machine's locale and once each forced to en-US and zh-CN (cx.SetLocale around Root), so the Chinese path is covered headless and in CI, not only on a Chinese machine. With the old English-only selectors the zh-CN subtests fail with the issue's error (nsgotest: no pressable view matches "text:Save").
  • TestDocsNameDemos skips on a target: it walks ../../docs/public, which the target's test app does not run beside, so it failed with lstat ../../docs/public: no such file or directory under -target macos. It still runs headless.

Fixes #555.

Validation

  • Headless (Ubuntu): go build ./..., go vet ./examples/previews for linux, windows, android/arm64 and js/wasm, go tool nsgo check -target all ./examples/previews, go tool nsgo test ./examples/previews (all subtests pass), go tool nsgo test -run 'Layer|Skills|Doc' ..
  • go tool nsgo test -target macos ./examples/previews on a Mac whose system language is Chinese (zh-Hans): 4 passed, 1 skipped (TestDocsNameDemos); the en-US subtests also pass on that target. With only the label fix, the same run still failed TestDocsNameDemos.

Screenshots

None (tests only).

@houko
houko force-pushed the fix/preview-test-locales branch from e112893 to 148e08f Compare November 17, 2026 18:09
@houko
houko force-pushed the fix/preview-test-locales branch from 148e08f to 16c49b2 Compare November 18, 2026 02:01
@github-actions github-actions Bot added size/S and removed size/XS labels Nov 18, 2026
@houko

houko commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed. The only CI failures are unrelated to this change: TestNestedZoomedCanvasIsSharp, fixed on main by #631, and the hosted runner's slow simulator boot, addressed by #634.

@houko
houko marked this pull request as ready for review November 18, 2026 04:42
@houko
houko merged commit ac10899 into main Nov 18, 2026
21 of 22 checks passed
@houko
houko deleted the fix/preview-test-locales branch November 18, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

examples/previews: TestButtonSays fails on a target whose locale is Chinese

1 participant