-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With MUI 5, the theme and style engine became stricter, therefore comps needed to be wrapped with the theme provider in some cases
- Loading branch information
Showing
9 changed files
with
62 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,33 @@ | ||
import '../../i18n/config.ts'; | ||
import { StyledEngineProvider, ThemeProvider } from '@mui/material/styles'; | ||
import { render } from '@testing-library/react'; | ||
import React from 'react'; | ||
import ListHeader from '../../components/common/ListHeader'; | ||
import ModalButton from '../../components/common/ModalButton'; | ||
import themes from '../../lib/themes'; | ||
|
||
describe('List Header', () => { | ||
const minProps = { | ||
title: 'Applications', | ||
actions: [<ModalButton modalToOpen="AddApplicationModal" data={{ applications: [] }} />], | ||
}; | ||
it('should render correct List Header title', () => { | ||
const { getByText } = render(<ListHeader title={minProps.title} />); | ||
const { getByText } = render( | ||
<StyledEngineProvider injectFirst> | ||
<ThemeProvider theme={themes['light']}> | ||
<ListHeader title={minProps.title} /> | ||
</ThemeProvider> | ||
</StyledEngineProvider> | ||
); | ||
expect(getByText(minProps.title)).toBeInTheDocument(); | ||
}); | ||
it('should render correct List Header actions', () => { | ||
const { asFragment } = render(<ListHeader actions={minProps.actions} />); | ||
const { asFragment } = render( | ||
<StyledEngineProvider injectFirst> | ||
<ThemeProvider theme={themes['light']}> | ||
<ListHeader actions={minProps.actions} /> | ||
</ThemeProvider> | ||
</StyledEngineProvider> | ||
); | ||
expect(asFragment()).toMatchSnapshot(); | ||
}); | ||
}); |
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,11 +1,18 @@ | ||
import '../../i18n/config.ts'; | ||
import { StyledEngineProvider, ThemeProvider } from '@mui/material/styles'; | ||
import { render } from '@testing-library/react'; | ||
import React from 'react'; | ||
import SearchInput from '../../components/common/ListSearch'; | ||
import themes from '../../lib/themes'; | ||
|
||
describe('List Search', () => { | ||
it('should render correct ListSearch', () => { | ||
const { asFragment } = render(<SearchInput />); | ||
const { asFragment } = render( | ||
<StyledEngineProvider injectFirst> | ||
<ThemeProvider theme={themes['light']}> | ||
<SearchInput /> | ||
</ThemeProvider> | ||
</StyledEngineProvider> | ||
); | ||
expect(asFragment()).toMatchSnapshot(); | ||
}); | ||
}); |
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
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