-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/12 formlayout test setup #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
15e5d8c
:sparkles: Use apiCall for API requests
robinmolen 735b094
:sparkles: [#12] Moved FormLayout decorator to the global decorators …
robinmolen d93a1cd
:sparkles: [#12] Making the BasicLayout component extendable
robinmolen 1157fcc
:sparkles: [#12] Using BasicLayout inside the FormLayout
robinmolen 40f9af1
:globe_with_meridians: [#12] Added translations
robinmolen c5f0725
:white_check_mark: [#12] Replacing Formik Field with TextField in For…
robinmolen 91c49ac
:pencil2: [#12] Typo in FormLayout.mdx
robinmolen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,24 @@ | ||
| import {ArgTypes, Canvas, Meta} from '@storybook/addon-docs/blocks'; | ||
|
|
||
| import * as BasicLayoutStories from './BasicLayout.stories'; | ||
|
|
||
| <Meta of={BasicLayoutStories} /> | ||
|
|
||
| # Basic Layout | ||
|
|
||
| The `BasicLayout` component is the generic layout component for most (if not all) pages in the | ||
| admin-ui. It provides a header, sidebar navigation, main content, and footer. | ||
|
|
||
| `BasicLayout` takes a optional `children` prop, which will be used as the main content of the page. | ||
| When the `children` property is not provided, a React-Router `<Outlet/>` will be used as the main | ||
| content, allowing regular Layout usage. | ||
|
|
||
| Because the `BasicLayout` component is used by other Layout components, we cannot assign it as a | ||
| global React-router Layout. Otherwise, the elements of the `BasicLayout` would be rendered multiple | ||
| times (as the global Layout, and in every Layout that uses it). | ||
|
|
||
| <Canvas of={BasicLayoutStories.Default} /> | ||
|
|
||
| ## Props | ||
|
|
||
| <ArgTypes /> |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this stay hardcoded like this? I can imagine you might want to supply values for this in tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mhh, yeah i think it should remain like this, for now.
Currently this decorator loads the storybook story as the index child of
forms/:uuid. By setting the initialEntry to this route, we force this page to be the initial page (i.e. when you use it in storybook, you immediately see your Story)I've tried something similar to your suggestion, where the initialEntries and routes can be set by the storybook tests themselves. It works, but makes this more complicated. Also, im not sure if we need this functionality at this moment.
This decorator is just to supply access to a QueryClient, so we can test somewhat real form detail page behaviour. I don't think that we, at this moment, require actual working routing and navigation between pages. When this does become a required feature, we can revisit this decorator and expand its capabilities.