-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Tests] Amend typos and extraneous <Set />
generic typings in router tests
#11894
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -925,11 +925,7 @@ test('Private is an alias for Set private', async () => { | |
const TestRouter = () => ( | ||
<Router useAuth={mockUseAuth({ isAuthenticated: true })}> | ||
<Route path="/" page={HomePage} name="home" /> | ||
<Private<PrivateLayoutProps> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With all the type change PRs reverted I think I want to keep this as it was. What's your thought on that, @Philzen? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the end of the day, these are completely redundant – there is no more or less TS errors in these files with or without them. But let me double check if it changes anything regarding auto-completion – although even then, they would be just noise in the test, as they don't serve any purpose concerning stuff that would be able to come up in a CI. My thought is to find a use case where they are actually required and implement a test for that, whilst removing those generics where they aren't. |
||
wrap={PrivateLayout} | ||
unauthenticated="home" | ||
theme="dark" | ||
> | ||
<Private wrap={PrivateLayout} unauthenticated="home" theme="dark"> | ||
<Route path="/private" page={PrivatePage} name="private" /> | ||
</Private> | ||
</Router> | ||
|
@@ -1228,11 +1224,7 @@ describe('Multiple nested private sets', () => { | |
const TestRouter = ({ useAuthMock }: { useAuthMock: UseAuth }) => ( | ||
<Router useAuth={useAuthMock}> | ||
<Route path="/" page={HomePage} name="home" /> | ||
<PrivateSet<LevelLayoutProps> | ||
unauthenticated="home" | ||
level="1" | ||
wrap={LevelLayout} | ||
> | ||
<PrivateSet unauthenticated="home" level="1" wrap={LevelLayout}> | ||
<Route | ||
path="/no-roles-assigned" | ||
page={PrivateNoRolesAssigned} | ||
|
@@ -1357,7 +1349,7 @@ describe('Multiple nested sets', () => { | |
const TestRouter = () => ( | ||
<Router> | ||
<Route path="/" page={HomePage} name="home" /> | ||
<Set<DebugLayoutProps> level="1" theme="blue" wrap={DebugLayout}> | ||
<Set level="1" theme="blue" wrap={DebugLayout}> | ||
<Route path="/level1" page={Page} name="level1" /> | ||
<Set level="2" theme="red" otherProp="bazinga"> | ||
<Route path="/level2" page={Page} name="level2" /> | ||
|
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.
I actually think this was better the way it was.
Had this been an
it
-test instead I would have agreed with your change. But withtest
I think "test: Give correct..." reads better(But I really wish all tests used
it()
)