Skip to content

Commit 7471bf2

Browse files
BrunoQuaresmaKira-Pilotmafredri
authored
Apply suggestions from code review
Co-authored-by: Kira Pilot <kira@coder.com> Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
1 parent dee5c3a commit 7471bf2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/contributing/frontend.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ All our dependencies are described in `site/package.json` but here are the most
1212
- [Material V4](https://v4.mui.com/) for UI components
1313
- [react-router](https://reactrouter.com/en/main) for routing
1414
- [TanStack Query v4](https://tanstack.com/query/v4/docs/react/overview) for fetching data
15-
- [XState](https://xstate.js.org/docs/) for handling complex flows
15+
- [XState](https://xstate.js.org/docs/) for handling complex state flows
1616
- [axios](https://github.com/axios/axios) as fetching lib
1717
- [Playwright](https://playwright.dev/) for E2E testing
1818
- [Jest](https://jestjs.io/) for integration testing
1919
- [Storybook](https://storybook.js.org/) and [Chromatic](https://www.chromatic.com/) for visual testing
2020

2121
## Structure
2222

23-
All the code related to the UI is inside the `site`` folder and we defined a few conventions to help people to navigate through it.
23+
All the code related to the UI is inside the `site` folder and we defined a few conventions to help people to navigate through it.
2424

2525
- **e2e** - E2E tests
2626
- **src** - Source code
@@ -38,19 +38,19 @@ All the code related to the UI is inside the `site`` folder and we defined a few
3838

3939
## Routing
4040

41-
We use [react-router](https://reactrouter.com/en/main) as our routing engine and adding a new route is very easy. If the new route needs to be authenticated, put it under the `<RequireAuth>` route, if it needs to live inside of the dashboard, put it under the `<DashboardLayout>`.
41+
We use [react-router](https://reactrouter.com/en/main) as our routing engine and adding a new route is very easy. If the new route needs to be authenticated, put it under the `<RequireAuth>` route and if it needs to live inside of the dashboard, put it under the `<DashboardLayout>` route.
4242

4343
The `RequireAuth` component handles all the authentication logic for the routes and the `DashboardLayout` wraps the route adding a navbar and passing down common dashboard data.
4444

4545
## Pages
4646

47-
Pages are the top-level components of the app. The page component lives under the `src/pages` folder and each page should have its own folder so we can better group the views, tests, utility functions and so on. We use a structure where the page component is responsible to fetch all the data and passing it down to the view. We explain this decision a bit better in the next section.
47+
Pages are the top-level components of the app. The page component lives under the `src/pages` folder and each page should have its own folder so we can better group the views, tests, utility functions and so on. We use a structure where the page component is responsible for fetching all the data and passing it down to the view. We explain this decision a bit better in the next section.
4848

49-
> ℹ️ Code that is only related to the page should live inside of the page folder but if at some point it is used from other pages or components, you should consider to move it to the `src` level in the `utils`, `hooks` or `components` folder.
49+
> ℹ️ Code that is only related to the page should live inside of the page folder but if at some point it is used in other pages or components, you should consider moving it to the `src` level in the `utils`, `hooks` or `components` folder.
5050
5151
### States
5252

53-
A page usually has three states at least: **loading**, **ready** or **success**, and **error** so remember to always handle these scenarios while you are coding a page. We also encourage you to add visual testing for these three states using the `*.stories.ts` file.
53+
A page usually has at least three states: **loading**, **ready** or **success**, and **error** so remember to always handle these scenarios while you are coding a page. We also encourage you to add visual testing for these three states using the `*.stories.ts` file.
5454

5555
## Fetching data
5656

@@ -112,7 +112,7 @@ We use three types of testing in our app: **E2E**, **Integration** and **Visual
112112

113113
### E2E (end-to-end)
114114

115-
Are useful to test complete flows like "Create a user", "Import template", etc. For this one, we use [Playwright](https://playwright.dev/). If you only need to test if the page is being rendered correctly, you should probably consider using the **Visual** Testing\*\* approach.
115+
Are useful to test complete flows like "Create a user", "Import template", etc. For this one, we use [Playwright](https://playwright.dev/). If you only need to test if the page is being rendered correctly, you should probably consider using the **Visual Testing** approach.
116116

117117
> ℹ️ For scenarios where you need to be authenticated, you can use `test.use({ storageState: getStatePath("authState") })`.
118118
@@ -126,7 +126,7 @@ Test components without user interaction like testing if a page view is rendered
126126

127127
### What should I test?
128128

129-
Choosing what to test is not always easier since there are a lot of flows and a lot of things can happen but definitely there are a few indicators that can help you with that.
129+
Choosing what to test is not always easy since there are a lot of flows and a lot of things can happen but these are a few indicators that can help you with that:
130130

131131
- Things that can block the user
132132
- Reported bugs

0 commit comments

Comments
 (0)