-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9dd195e
commit 0127b3a
Showing
1 changed file
with
14 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,19 @@ | ||
import React from "react"; | ||
import { shallow } from "enzyme"; | ||
import { CircularProgress } from "@mui/material"; | ||
import { LoaderGrid } from "./LoaderStyled"; | ||
import { Loader } from "./Loader"; | ||
import React from 'react'; | ||
import { ThemeProvider } from '@mui/material'; | ||
import { Loader } from './Loader'; | ||
import theme from '../../theme'; | ||
import { render, screen } from '@testing-library/react'; | ||
|
||
describe("Loader component", () => { | ||
it("renders without crashing", () => { | ||
const wrapper = shallow(<Loader />); | ||
expect(wrapper.exists()).toBe(true); | ||
}); | ||
describe('Loader component', () => { | ||
|
||
it("renders the LoaderGrid component", () => { | ||
const wrapper = shallow(<Loader />); | ||
const loaderGridComponent = wrapper.find(LoaderGrid); | ||
expect(loaderGridComponent).toHaveLength(1); | ||
}); | ||
const TestWrapper = (props) => <ThemeProvider theme={theme}>{props.children}</ThemeProvider>; | ||
|
||
it('should render correctly', () => { | ||
render(<TestWrapper> | ||
<Loader /> | ||
</TestWrapper>); | ||
|
||
expect(screen.getByRole('progressbar')).toBeInTheDocument(); | ||
|
||
it("renders the CircularProgress component", () => { | ||
const wrapper = shallow(<Loader />); | ||
const circularProgressComponent = wrapper.find(CircularProgress); | ||
expect(circularProgressComponent).toHaveLength(1); | ||
}); | ||
}); |