Skip to content

fix(tests): unblock the display name smoke test - #716

Merged
bmc08gt merged 2 commits into
mainfrom
fix/display-name-smoke-confirm-dialog
Sep 3, 2026
Merged

bmc08gt merged 2 commits into
mainfrom
fix/display-name-smoke-confirm-dialog

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

DisplayNameSmokeTests.testDisplayName_yieldsTipCard_andCanBeChanged fails on main, and fails identically at 06678487 — the commit before the chat edit/delete stack — so it predates that work.

Two separate causes, both in the test.

The rename confirmation was never answered. Replacing a display name that is already set raises Change Display Name? on Save: ProfileNameScreen.submit() only saves straight through when the profile carries no name, which is the onboarding case. The test tapped Save and then waited its full 60s for ProfileNameScreen(completion: .back) to pop, with the dialog sitting on screen the whole time. It now taps the dialog's confirm action, scoped to the dialog container the way AccessKeyBackupSmokeTests and BlockUnblockSmokeTests scope theirs. The assertion behind it is unchanged — landing back on My Account is still what proves the name was accepted.

save.isEnabled was sampled too early. Once the seeded name is deleted, the emptied field reaches the button on SwiftUI's next render, and under a full-suite load that lands after the typing has settled, so the read caught the state the button was leaving. It now waits for isEnabled == false, the way verifyPhoneIfNeeded waits for its Confirm button to go away, and names the field's contents if the wait times out. That second failure only surfaced in a full-suite run; the first is deterministic in isolation.

…test

Renaming from My Account raises "Change Display Name?" on Save, so
`ProfileNameScreen` stayed up behind the dialog and the test burned its
60s wait for the pop back to My Account. Tap the dialog's confirm action
between Save and that assertion; landing back on My Account still proves
the name was accepted.
`save.isEnabled` was read straight after the deletes, which catches the
state the button is leaving: the emptied field reaches it on SwiftUI's
next render, and under a full-suite load that lands after the typing has
settled. Failed once that way in a full run — the field read back as its
placeholder, so it was already empty.

Wait for `isEnabled == false` instead, the way the phone-verification
helper waits for its Confirm button, and name the field's contents when
the wait times out.
@bmc08gt bmc08gt self-assigned this Sep 3, 2026
@bmc08gt
bmc08gt merged commit c4bcac7 into main Sep 3, 2026
1 check passed
@bmc08gt
bmc08gt deleted the fix/display-name-smoke-confirm-dialog branch September 15, 2026 17:49
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