Skip to content

Fix TerminalApp local tests after FRE deferral - #552

Open
Gordon Lam (yeelam-gordon) wants to merge 1 commit into
mainfrom
dev/yeelam/fix-terminalapp-localtests-initialization
Open

Fix TerminalApp local tests after FRE deferral#552
Gordon Lam (yeelam-gordon) wants to merge 1 commit into
mainfrom
dev/yeelam/fix-terminalapp-localtests-initialization

Conversation

@yeelam-gordon

Copy link
Copy Markdown
Contributor

Summary

  • run TerminalApp tab behavior tests in an explicit post-FRE state
  • restore the previous AgentFreCompleted value after page initialization
  • fix the 15 TabTests failures caused by FRE intentionally deferring initial tab creation

Root cause

TerminalPage now defers startup actions while the first-run experience is active. The local tab tests waited for Initialized and then assumed the first tab existed, so page->_tabs.GetAt(0) threw 0x8000FFFF. These tests exercise normal tab behavior rather than onboarding, so the helper now temporarily marks FRE complete while initializing the page.

Validation

  • TerminalAppLocalTests::TabTests: 21/21 passed
  • Main Release unit-test group: 7,043 passed, 0 failed, 2 skipped
  • SettingsModel Release unit-test group: 194/194 passed

All executed unit tests pass. Please sign off on the fix.

Run tab behavior tests with the first-run experience temporarily marked complete so startup creates the expected initial tab, then restore the original application state.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 50b8acf2-0ef6-4e57-b95a-c92eb1f05054
Copilot AI lite review requested due to automatic review settings August 6, 2026 06:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes TerminalAppLocalTests::TabTests failures caused by TerminalPage deferring initial tab creation while the first-run experience (FRE) is active, by initializing the test TerminalPage in an explicit post-FRE state and then restoring the prior FRE completion flag.

Changes:

  • Temporarily sets ApplicationState::AgentFreCompleted(true) while initializing a TerminalPage in TabTests::_initializeTerminalPage.
  • Restores the previous AgentFreCompleted value after initialization completes.

Comment on lines +232 to +237
const auto applicationState = ApplicationState::SharedInstance();
const auto agentFreCompleted = applicationState.AgentFreCompleted();
applicationState.AgentFreCompleted(true);
const auto restoreAgentFreCompleted = wil::scope_exit([&]() {
applicationState.AgentFreCompleted(agentFreCompleted);
});
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.

2 participants