mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5801] [MERGED] test(ui): fix the flaky preset accent spec by waiting for the editor dirty flag #6940
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6940
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5801
Author: @kolacheee
Created: 9/3/2026
Status: ✅ Merged
Merged: 9/3/2026
Merged by: @kolacheee
Base:
staging← Head:fix/5788-flaky-preset-accent📝 Commits (1)
16e5219test(ui): wait for the editor dirty flag before closing (#5788)📊 Changes
1 file changed (+27 additions, -1 deletions)
View changed files
📝
e2e/core-flows.e2e.ts(+27 -1)📄 Description
Linked issue
Closes #5788
Why this change
mobile-webkitacross at least three unrelated PRs (#5755, #5787, and one full-matrix rerun), each time costing a rerun cycle on work that never touched the preset surface. It is the single most disruptive flake in the suite right now.What the failure actually is
The failing assertion is the unsaved-changes warning, and the error is
element(s) not foundrather than a visibility timeout:The editor's back button branches on the dirty flag (
PresetEditor.tsx):So the spec's
fill()→ immediateclick()is a race against the app committing the edit. When the dirty flag has not registered yet, the click takes the not-dirty branch: the editor closes, the whole shell unmounts, and the following assertion finds nothing at all — exactly the reported error, and exactly why a rerun "fixes" it.setDirty(false)exists in only one place (the save handler), so a stale flag at click time is the only path to this failure.What changed
waitForEditorDirty(page)helper: detail editors mirror their unsaved-changes flag into the UI store (editorDirty— documented there as "True when any open detail editor has unsaved changes"), which is the same flag the back button branches on. The spec now waits for the app's own signal instead of assuming a keystroke is already committed. Note the failure semantics improve too: if the edit genuinely never registers, this now fails deterministically at the wait with a clear cause, instead of intermittently three assertions later.Lorebook vectorization saves pending eligibility settings firstruns the same fill → back-button → expect-warning shape against the same store flag, so it looked like the same latent flake. It isn't: that flow edits the field earlier and cancels out of a dialog without saving (the spec asserts the save count is unchanged), so the editor is already dirty by the time it clicks back. A wait there would pass instantly and protect nothing, so it is left alone rather than added as decoration.setTimeout(() => setShowSaved(false), 1500)), and the spec was spending apage.evaluateround trip inside that window before asserting the toast is visible. That is a second, latent flake of the same family in the same test; reading the accent first costs nothing and removes it.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
npx tsc --noEmit -p tsconfig.json(thecheck:e2e-typesleg) and Prettier both pass.mobile-webkit(8 + 5 across two runs) and 3 ondesktop-chromium, since the spec runs on all three projects.handleClosebranch that is the only way to produce it), not on a local red-to-green transition. The real proof will be this spec staying green across the matrix over the coming weeks.b2c412e4a,34d1f7f41).Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
Not applicable — end-to-end test changes only, no product code touched.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.