Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 33c0674

Browse files
chore: bump react-router-dom from 6.4.1 to 6.12.1 in /site (#7950)
* chore: bump react-router-dom from 6.4.1 to 6.12.1 in /site Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.4.1 to 6.12.1. - [Release notes](https://github.com/remix-run/react-router/releases) - [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md) - [Commits](https://github.com/remix-run/react-router/commits/[email protected]/packages/react-router-dom) --- updated-dependencies: - dependency-name: react-router-dom dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * fix what needs to be fixed * fix storybook --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: BrunoQuaresma <[email protected]>
1 parent 6e59823 commit 33c0674

24 files changed

+142
-394
lines changed

site/.storybook/preview.jsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import CssBaseline from "@mui/material/CssBaseline"
22
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles"
3-
import { createMemoryHistory } from "history"
4-
import { unstable_HistoryRouter as HistoryRouter } from "react-router-dom"
3+
4+
import { MemoryRouter } from "react-router-dom"
55
import { HelmetProvider } from "react-helmet-async"
66
import { dark } from "../src/theme"
77
import "../src/theme/globalFonts"
88
import "../src/i18n"
99

10-
const history = createMemoryHistory()
11-
1210
export const decorators = [
1311
(Story) => (
1412
<StyledEngineProvider injectFirst>
@@ -20,9 +18,9 @@ export const decorators = [
2018
),
2119
(Story) => {
2220
return (
23-
<HistoryRouter history={history}>
21+
<MemoryRouter>
2422
<Story />
25-
</HistoryRouter>
23+
</MemoryRouter>
2624
)
2725
},
2826
(Story) => {

site/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"eventsourcemock": "2.0.0",
6565
"formik": "2.4.1",
6666
"front-matter": "4.0.2",
67-
"history": "5.3.0",
6867
"i18next": "22.5.0",
6968
"jest-environment-jsdom": "29.5.0",
7069
"jest-location-mock": "1.0.9",
@@ -80,7 +79,7 @@
8079
"react-helmet-async": "1.3.0",
8180
"react-i18next": "12.2.2",
8281
"react-markdown": "8.0.3",
83-
"react-router-dom": "6.4.1",
82+
"react-router-dom": "6.13.0",
8483
"react-syntax-highlighter": "15.5.0",
8584
"react-use": "17.4.0",
8685
"react-virtualized-auto-sizer": "1.0.7",

site/src/AppRouter.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export const AppRouter: FC = () => {
292292
/>
293293
</Route>
294294

295-
<Route path="/@:username">
295+
<Route path="/:username">
296296
<Route path=":workspace">
297297
<Route index element={<WorkspacePage />} />
298298
<Route
@@ -316,7 +316,7 @@ export const AppRouter: FC = () => {
316316

317317
{/* Terminal and CLI auth pages don't have the dashboard layout */}
318318
<Route
319-
path="/@:username/:workspace/terminal"
319+
path="/:username/:workspace/terminal"
320320
element={<TerminalPage />}
321321
/>
322322
<Route path="cli-auth" element={<CliAuthenticationPage />} />

site/src/components/Dialogs/ConfirmDialog/ConfirmDialog.test.tsx

+9-22
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
1-
import { fireEvent, render, screen } from "@testing-library/react"
2-
import { FC } from "react"
3-
import { WrapperComponent } from "../../../testHelpers/renderHelpers"
1+
import { fireEvent, screen } from "@testing-library/react"
42
import { ConfirmDialog, ConfirmDialogProps } from "./ConfirmDialog"
5-
6-
namespace Helpers {
7-
export const Component: FC<React.PropsWithChildren<ConfirmDialogProps>> = (
8-
props: ConfirmDialogProps,
9-
) => {
10-
return (
11-
<WrapperComponent>
12-
<ConfirmDialog {...props} />
13-
</WrapperComponent>
14-
)
15-
}
16-
}
3+
import { render } from "testHelpers/renderHelpers"
174

185
describe("ConfirmDialog", () => {
196
it("renders", () => {
@@ -26,7 +13,7 @@ describe("ConfirmDialog", () => {
2613
}
2714

2815
// When
29-
render(<Helpers.Component {...props} />)
16+
render(<ConfirmDialog {...props} />)
3017

3118
// Then
3219
expect(screen.getByRole("dialog")).toBeDefined()
@@ -43,7 +30,7 @@ describe("ConfirmDialog", () => {
4330
}
4431

4532
// When
46-
render(<Helpers.Component {...props} />)
33+
render(<ConfirmDialog {...props} />)
4734

4835
// Then
4936
expect(screen.queryByText("CANCEL")).toBeNull()
@@ -61,7 +48,7 @@ describe("ConfirmDialog", () => {
6148
}
6249

6350
// When
64-
render(<Helpers.Component {...props} />)
51+
render(<ConfirmDialog {...props} />)
6552

6653
// Then
6754
expect(screen.getByText("CANCEL")).toBeDefined()
@@ -79,7 +66,7 @@ describe("ConfirmDialog", () => {
7966
}
8067

8168
// When
82-
render(<Helpers.Component {...props} />)
69+
render(<ConfirmDialog {...props} />)
8370

8471
// Then
8572
expect(screen.getByText("CANCEL")).toBeDefined()
@@ -98,7 +85,7 @@ describe("ConfirmDialog", () => {
9885
}
9986

10087
// When
101-
render(<Helpers.Component {...props} />)
88+
render(<ConfirmDialog {...props} />)
10289

10390
// Then
10491
expect(screen.queryByText("CANCEL")).toBeNull()
@@ -116,7 +103,7 @@ describe("ConfirmDialog", () => {
116103
}
117104

118105
// When
119-
render(<Helpers.Component {...props} />)
106+
render(<ConfirmDialog {...props} />)
120107
fireEvent.click(screen.getByText("CANCEL"))
121108

122109
// Then
@@ -138,7 +125,7 @@ describe("ConfirmDialog", () => {
138125
}
139126

140127
// When
141-
render(<Helpers.Component {...props} />)
128+
render(<ConfirmDialog {...props} />)
142129
fireEvent.click(screen.getByText("CONFIRM"))
143130

144131
// Then

site/src/components/UserCell/UserCell.stories.tsx

-34
This file was deleted.

site/src/components/UserCell/UserCell.test.tsx

-87
This file was deleted.

site/src/components/UserCell/UserCell.tsx

-69
This file was deleted.

site/src/pages/LoginPage/LoginPage.test.tsx

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { fireEvent, screen } from "@testing-library/react"
22
import userEvent from "@testing-library/user-event"
33
import { rest } from "msw"
4-
import { Route, Routes } from "react-router-dom"
4+
import { createMemoryRouter } from "react-router-dom"
55
import { Language } from "../../components/SignInForm/SignInForm"
66
import {
7-
history,
87
render,
8+
renderWithRouter,
99
waitForLoaderToBeRemoved,
1010
} from "../../testHelpers/renderHelpers"
1111
import { server } from "../../testHelpers/server"
@@ -17,7 +17,6 @@ const { t } = i18n
1717

1818
describe("LoginPage", () => {
1919
beforeEach(() => {
20-
history.replace("/login")
2120
// appear logged out
2221
server.use(
2322
rest.get("/api/v2/users/me", (req, res, ctx) => {
@@ -58,7 +57,6 @@ describe("LoginPage", () => {
5857
// Then
5958
const errorMessage = await screen.findByText(apiErrorMessage)
6059
expect(errorMessage).toBeDefined()
61-
expect(history.location.pathname).toEqual("/login")
6260
})
6361

6462
it("shows github authentication when enabled", async () => {
@@ -92,11 +90,20 @@ describe("LoginPage", () => {
9290
)
9391

9492
// When
95-
render(
96-
<Routes>
97-
<Route path="/login" element={<LoginPage />}></Route>
98-
<Route path="/setup" element={<h1>Setup</h1>}></Route>
99-
</Routes>,
93+
renderWithRouter(
94+
createMemoryRouter(
95+
[
96+
{
97+
path: "/login",
98+
element: <LoginPage />,
99+
},
100+
{
101+
path: "/setup",
102+
element: <h1>Setup</h1>,
103+
},
104+
],
105+
{ initialEntries: ["/login"] },
106+
),
100107
)
101108

102109
// Then

0 commit comments

Comments
 (0)