Skip to content

Reset language settings before each full e2e test - #474

Merged
bartekplus merged 3 commits into
masterfrom
claude/nostalgic-lichterman-94a0a9
Oct 5, 2026
Merged

bartekplus merged 3 commits into
masterfrom
claude/nostalgic-lichterman-94a0a9

Conversation

@bartekplus

@bartekplus bartekplus commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

The e2e test "Grammar Rule Engine formats measurement units only in verified prose typing" failed when it ran after other tests. It passed when it ran alone. This PR fixes the cause for all languages, not only for this test.

Root cause

The test "Auto-detect switches to Arabic for Arabic-script typing" sets enabled_languages to ["en_US", "ar_SA"], and its finally block does not reset this setting. The beforeEach hook of the full suite reset only the grammar rules.

The measurement test then sets the language to pl_PL. Because pl_PL is not enabled, resolveFallbackLanguage (src/core/domain/lang.ts) changes it to en_US. The Polish decimal step ("Masa: 1,50kg ") then runs with English rules, and the wait times out.

Seven tests in the full suite narrow enabled_languages (for example ["en_US"], ["en_US", "el_GR"] and ["textExpander"]). Any later test that sets a language outside the narrowed list has the same problem.

Changes

  • Baseline settings: a new PER_TEST_RESET_SETTINGS object holds the defaults that each full-suite test starts from: no grammar rules, all languages enabled, en_US as language and fallback, no site profiles, no auto-detect site priors, inline_suggestion off, the default num_suggestions and min_word_length_to_predict = 1. The smoke suite has a similar object.
  • When the reset runs: before, beforeEach reset only after a test helper wrote settings. The popup, the options page and commands also write settings. A new helper, storedSettingsDiffer, reads the baseline keys in one storage call. The hook now resets when a helper wrote settings or when a stored value is not equal to the baseline.
  • Duplicate resets removed: the finally blocks of three auto-detect tests and the reset at the end of the popup language test did the same reset as the baseline. They are removed.
  • Measurement unit test: the test uses the openEnglishField helper, like the other grammar tests. Its language reset at the end is removed.

Test plan

On Chrome:

  • Full suite bun run test:e2e:full --platform=chrome: 200 pass, 0 fail
  • --test-name-pattern "typing|Quill|quill|CKEditor|ckeditor": 39 pass, 0 fail (before: 38 pass, 1 fail)
  • The measurement test alone: 1 pass
  • bun run check passes
  • Firefox: not run locally. Firefox did not start on the dev machine ("Could not find profile folder"). CI runs Firefox.

🤖 Generated with Claude Code

The Arabic auto-detect test sets enabled_languages to ["en_US", "ar_SA"].
With pl_PL disabled, resolveFallbackLanguage changes pl_PL to en_US, and
the Polish decimal step fails in an ordered run. The test now uses
openEnglishField, which enables all languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Seven tests narrow enabled_languages and do not restore it. With a
narrowed list, resolveFallbackLanguage changes the language of a later
test to the first enabled language. The beforeEach baseline now sets the
enabled languages, the language, the fallback language, the site
profiles and the auto-detect site priors to their defaults. It writes
them in one storage call with the grammar rules.

The measurement unit test no longer resets the language at its end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bartekplus bartekplus changed the title Fix order-dependent failure of the measurement unit e2e test Reset language settings before each full e2e test Oct 5, 2026
The beforeEach reset ran only after writes from the test helpers. The
popup, the options page and commands also write settings, and those
changes leaked into the next test. The hook now also reads the baseline
keys and resets them when they are not equal to the baseline.

The baseline now also sets inline_suggestion, num_suggestions and
min_word_length to their defaults. The language resets in the
auto-detect tests and in the popup language test are removed, because
the baseline does them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bartekplus
bartekplus merged commit ec19b7a into master Oct 5, 2026
13 checks passed
@bartekplus
bartekplus deleted the claude/nostalgic-lichterman-94a0a9 branch October 5, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant