Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function openMoneyFtueSplash(
): Promise<MoneyFtueSplashPage> {
const bottomNavBar = new BottomNavBar(driver);
await bottomNavBar.checkPageIsLoaded();
await bottomNavBar.clickMoney({ assertRoute: false });
await bottomNavBar.clickMoney();

const splash = new MoneyFtueSplashPage(driver);
await splash.checkPageIsLoaded();
Expand Down
12 changes: 2 additions & 10 deletions test/e2e/page-objects/pages/home/bottom-nav-bar-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,11 @@ class BottomNavBar {
/**
* Click the Money tab. Only rendered once the Money Account availability
* query resolves, so wait for it rather than failing on first paint.
*
* @param options - Click options.
* @param [options.assertRoute] - Whether to assert the Money home route. Set
* to `false` when the first-visit FTUE splash is expected instead.
*/
async clickMoney({
assertRoute = true,
}: { assertRoute?: boolean } = {}): Promise<void> {
async clickMoney(): Promise<void> {
console.log('Click bottom nav money tab');
await this.driver.clickElement(this.moneyTab);
if (assertRoute) {
await this.assertOnRoute('/money-home');
}
await this.assertOnRoute('/money-home');
}
}

Expand Down
9 changes: 7 additions & 2 deletions test/e2e/tests/money/money-ftue-splash.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ describe('Money Account FTUE', function (this: Suite) {
await login(driver);

const splash = await openMoneyFtueSplash(driver);
await splash.clickStartEarning();

// Money home mounts and loads behind the splash.
const moneyHomePage = new MoneyHomePage(driver);
await moneyHomePage.checkPageIsLoaded();

await splash.clickStartEarning();
await moneyHomePage.checkPageIsLoaded();
await splash.checkIsNotShown();

// Reload so the persisted seen flag is read back from background
Expand All @@ -49,10 +52,12 @@ describe('Money Account FTUE', function (this: Suite) {
await login(driver);

const splash = await openMoneyFtueSplash(driver);
await splash.clickClose();

const moneyHomePage = new MoneyHomePage(driver);
await moneyHomePage.checkPageIsLoaded();

await splash.clickClose();
await moneyHomePage.checkPageIsLoaded();
await splash.checkIsNotShown();
},
);
Expand Down
4 changes: 2 additions & 2 deletions ui/hooks/useMainNavItems.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ describe('useMainNavItems', () => {
});
});

it('opens the FTUE splash without navigating on the first Money click', () => {
it('opens the FTUE splash and navigates to Money Home on the first Money click', () => {
const { result, store } = renderUseMainNavItems(
createState({ moneyFtueSeen: false }),
);
Expand All @@ -240,7 +240,7 @@ describe('useMainNavItems', () => {
pendingDeposit: null,
acknowledged: false,
});
expect(mockNavigate).not.toHaveBeenCalled();
expect(mockNavigate).toHaveBeenCalledWith(MONEY_HOME_ROUTE);
expect(mockMoneyAnalytics.trackButtonClicked).toHaveBeenCalledWith({
buttonType: MoneyButtonType.Text,
buttonIntent: MoneyButtonIntent.GoToMoneyHome,
Expand Down
1 change: 0 additions & 1 deletion ui/hooks/useMainNavItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export function useMainNavItems(): MainNavItem[] {
});
if (!hasSeenMoneyFtue) {
dispatch(openMoneyFtue({ source: 'moneyHome' }));
return;
}

transitionForward(() => navigate(MONEY_HOME_ROUTE));
Expand Down
Loading