Skip to content

Commit

Permalink
Fixed linting in Loader component
Browse files Browse the repository at this point in the history
Signed-off-by: Akhilender <[email protected]>
  • Loading branch information
akhilender-bongirwar committed Nov 7, 2023
1 parent fabde73 commit 78c0eca
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions src/components/Loader/Loader.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,39 @@ describe('Testing Loader component', () => {
</BrowserRouter>
);

const spinner = screen.getByTestId('spinner');
expect(screen.getByTestId('spinner-wrapper')).toBeInTheDocument();
expect(screen.getByTestId('spinner')).toBeInTheDocument();
expect(screen.getByTestId('spinner')).toHaveClass(
expect(spinner).toBeInTheDocument();
expect(spinner).toHaveClass(
'_spinnerSm_1vy2z_21 spinner-border text-primary'
);
});

test('Component should render with large size', () => {
render(<Loader size="lg" />);
render(
<BrowserRouter>
<Loader size="lg" />
</BrowserRouter>
);

const spinner = screen.getByTestId('spinner');
expect(screen.getByTestId('spinner-wrapper')).toBeInTheDocument();
expect(spinner).toBeInTheDocument();
expect(spinner).toHaveClass(
'_spinnerLg_1vy2z_15 spinner-border text-primary'
);
});

test('renders with extra-large size', () => {
render(<Loader size="xl" />);
const spinner = screen.getByTestId('spinner');
render(
<BrowserRouter>
<Loader size="xl" />
</BrowserRouter>
);

const spinner = screen.getByTestId('spinner');
expect(screen.getByTestId('spinner-wrapper')).toBeInTheDocument();
expect(spinner).toBeInTheDocument();
expect(spinner).toHaveClass(
'_spinnerXl_1vy2z_9 spinner-border text-primary'
);
Expand Down

0 comments on commit 78c0eca

Please sign in to comment.