Skip to content

A local-first personal finance app

:bug: navigation back to config-server page after clicking on "no server" (#851)

Matiss Janis Aboltins0dd553691434
diff --git a/packages/desktop-client/e2e/onboarding.test.js b/packages/desktop-client/e2e/onboarding.test.js
index a0875be4a2..b697852beb 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 ecaaa8a42e..3b5e8c6c99 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 d256c5202b..ad04a63873 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 b7ed7bda6d..e8add431e6 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 355929d58d..96282dd036 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 0000000000..a334a3bfe3
--- /dev/null
+++ b/upcoming-release-notes/851.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [MatissJanis]
+---
+
+Fix "no server" link no longer working