From 0dd5536914341be89ef4086cf7cfb8d8a9fdc534 Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins <matiss@mja.lv> Date: Tue, 4 Apr 2023 18:34:59 +0100 Subject: [PATCH] :bug: navigation back to config-server page after clicking on "no server" (#851) Closes #842 --------- Co-authored-by: Jed Fox <git@jedfox.com> --- packages/desktop-client/e2e/onboarding.test.js | 9 +++++++++ .../desktop-client/e2e/page-models/configuration-page.js | 2 ++ packages/desktop-client/e2e/page-models/navigation.js | 4 ++++ .../src/components/manager/ManagementApp.js | 4 ++-- .../src/components/manager/subscribe/common.js | 4 ++-- upcoming-release-notes/851.md | 6 ++++++ 6 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 upcoming-release-notes/851.md diff --git a/packages/desktop-client/e2e/onboarding.test.js b/packages/desktop-client/e2e/onboarding.test.js index a0875be4a..b697852be 100644 --- a/packages/desktop-client/e2e/onboarding.test.js +++ b/packages/desktop-client/e2e/onboarding.test.js @@ -68,4 +68,13 @@ test.describe('Onboarding', () => { await expect(accountPage.accountName).toHaveText('All Accounts'); await expect(accountPage.accountBalance).toHaveText('0.00'); }); + + test('navigates back to start page by clicking on "no server" in an empty budget file', async () => { + await configurationPage.clickOnNoServer(); + await configurationPage.startFresh(); + + await navigation.clickOnNoServer(); + + expect(await configurationPage.heading).toHaveText('Where’s the server?'); + }); }); diff --git a/packages/desktop-client/e2e/page-models/configuration-page.js b/packages/desktop-client/e2e/page-models/configuration-page.js index ecaaa8a42..3b5e8c6c9 100644 --- a/packages/desktop-client/e2e/page-models/configuration-page.js +++ b/packages/desktop-client/e2e/page-models/configuration-page.js @@ -3,6 +3,8 @@ import { BudgetPage } from './budget-page'; export class ConfigurationPage { constructor(page) { this.page = page; + + this.heading = page.getByRole('heading'); } async createTestFile() { diff --git a/packages/desktop-client/e2e/page-models/navigation.js b/packages/desktop-client/e2e/page-models/navigation.js index d256c5202..ad04a6387 100644 --- a/packages/desktop-client/e2e/page-models/navigation.js +++ b/packages/desktop-client/e2e/page-models/navigation.js @@ -70,4 +70,8 @@ export class Navigation { await this.page.getByRole('button', { name: 'Create' }).click(); return new AccountPage(this.page); } + + async clickOnNoServer() { + await this.page.getByRole('button', { name: 'No server' }).click(); + } } diff --git a/packages/desktop-client/src/components/manager/ManagementApp.js b/packages/desktop-client/src/components/manager/ManagementApp.js index b7ed7bda6..e8add431e 100644 --- a/packages/desktop-client/src/components/manager/ManagementApp.js +++ b/packages/desktop-client/src/components/manager/ManagementApp.js @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; import { Switch, Redirect, Router, Route } from 'react-router-dom'; @@ -58,7 +58,7 @@ function ManagementApp({ getUserData, loadAllFiles, }) { - const history = createBrowserHistory(); + const [history] = useState(createBrowserHistory); window.__history = history; // runs on mount only diff --git a/packages/desktop-client/src/components/manager/subscribe/common.js b/packages/desktop-client/src/components/manager/subscribe/common.js index 355929d58..96282dd03 100644 --- a/packages/desktop-client/src/components/manager/subscribe/common.js +++ b/packages/desktop-client/src/components/manager/subscribe/common.js @@ -80,7 +80,7 @@ export function getEmail(location) { export function Title({ text }) { return ( - <Text + <h1 style={{ fontSize: 40, fontWeight: 700, @@ -89,7 +89,7 @@ export function Title({ text }) { }} > {text} - </Text> + </h1> ); } diff --git a/upcoming-release-notes/851.md b/upcoming-release-notes/851.md new file mode 100644 index 000000000..a334a3bfe --- /dev/null +++ b/upcoming-release-notes/851.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [MatissJanis] +--- + +Fix "no server" link no longer working -- GitLab