-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add ToastContainer to render helper function in library (#14159)
- Loading branch information
Showing
5 changed files
with
21 additions
and
15 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
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
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
9 changes: 0 additions & 9 deletions
9
frontend/libs/studio-content-library/test-utils/renderWithBrowserRouter.tsx
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
frontend/libs/studio-content-library/test-utils/renderWithProviders.tsx
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 type { ReactNode } from 'react'; | ||
import React from 'react'; | ||
import { BrowserRouter } from 'react-router-dom'; | ||
import type { RenderResult } from '@testing-library/react'; | ||
import { render } from '@testing-library/react'; | ||
import { ToastContainer, Slide } from 'react-toastify'; | ||
|
||
export function renderWithProviders(component: ReactNode): RenderResult { | ||
return render( | ||
<> | ||
<ToastContainer position='top-center' theme='colored' transition={Slide} draggable={false} /> | ||
<BrowserRouter>{component}</BrowserRouter> | ||
</>, | ||
); | ||
} |