-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #152 from aiven/smulis-137
feat[coral]: add first dummy application routes
- Loading branch information
Showing
11 changed files
with
94 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
import App from "./App"; | ||
import { RouterProvider } from "react-router-dom"; | ||
import router from "./router"; | ||
|
||
import "@aivenio/design-system/dist/styles.css"; | ||
|
||
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( | ||
<React.StrictMode> | ||
<App /> | ||
<RouterProvider router={router} /> | ||
</React.StrictMode> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import HelloPage from "./index"; | ||
import { render, cleanup, screen } from "@testing-library/react"; | ||
|
||
describe("HelloPage", () => { | ||
beforeEach(() => { | ||
render(<HelloPage />); | ||
}); | ||
|
||
afterEach(() => { | ||
cleanup(); | ||
}); | ||
it("shoud render dummy content", () => { | ||
expect(screen.getByText("Hello")).toBeVisible(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const HelloPage = () => <h1>Hello</h1>; | ||
|
||
export default HelloPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import HomePage from "./index"; | ||
import { render, cleanup, screen } from "@testing-library/react"; | ||
|
||
describe("HomePage", () => { | ||
beforeEach(() => { | ||
render(<HomePage />); | ||
}); | ||
|
||
afterEach(() => { | ||
cleanup(); | ||
}); | ||
it("shoud render dummy content", () => { | ||
expect(screen.getByText("Index")).toBeVisible(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const HomePage = () => <h1>Index</h1>; | ||
|
||
export default HomePage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { createBrowserRouter, Navigate, RouteObject } from "react-router-dom"; | ||
import HomePage from "./pages/index"; | ||
import HelloPage from "./pages/hello"; | ||
|
||
const routes: Array<RouteObject> = [ | ||
{ | ||
path: "/", | ||
element: <HomePage />, | ||
}, | ||
{ | ||
path: "/hello", | ||
element: <HelloPage />, | ||
}, | ||
{ | ||
path: "*", | ||
element: <Navigate to="/" />, | ||
}, | ||
]; | ||
|
||
const router = createBrowserRouter(routes); | ||
|
||
export default router; |