Skip to content

Commit

Permalink
test: removing test which generate snpshots
Browse files Browse the repository at this point in the history
  • Loading branch information
sahsisunny committed Nov 7, 2023
1 parent 64dbee4 commit 63073c9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
5 changes: 0 additions & 5 deletions __tests__/components/ProfileIcon.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ import { render } from '@testing-library/react';
import ProfileIcon from '@/components/ProfileIcon/ProfileIcon';

describe('ProfileIcon', () => {
it('should render', () => {
const { container } = render(<ProfileIcon firstName="Sunny" lastName="Sahsi" size={50} />);
expect(container).toMatchSnapshot();
});

it('should have the correct initials', () => {
const { container } = render(<ProfileIcon firstName="Sunny" lastName="Sahsi" size={50} />);
expect(container).toHaveTextContent('SS');
Expand Down
16 changes: 0 additions & 16 deletions __tests__/components/Toast.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,12 @@ import Toast from '../../src/components/Toast';
describe('Toast', () => {
const onDismiss = jest.fn();

test('should render the toast component', () => {
const { container } = render(
<Toast message="This is a toast message" isVisible={true} timeToShow={5000} onDismiss={onDismiss} />
);

expect(container).toMatchSnapshot();
});

test('should render the toast component with the message', () => {
render(<Toast message="This is a toast message" isVisible={true} timeToShow={5000} onDismiss={onDismiss} />);

expect(screen.getByText('This is a toast message')).toBeInTheDocument();
});

test('should not render the toast component', () => {
const { container } = render(
<Toast message="This is a toast message" isVisible={false} timeToShow={5000} onDismiss={onDismiss} />
);

expect(container).toMatchSnapshot();
});

test('should not call onDismiss function when the timeToShow is not completed', () => {
render(<Toast message="This is a toast message" isVisible={true} timeToShow={5000} onDismiss={onDismiss} />);

Expand Down
5 changes: 0 additions & 5 deletions __tests__/pages/login.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ import { fireEvent, render } from '@testing-library/react';
import LoginPage from '../../src/pages/login';

describe('LoginPage', () => {
it('should render without throwing an error', () => {
const { container } = render(<LoginPage />);
expect(container).toMatchSnapshot();
});

it('should render username input', () => {
const { getByLabelText } = render(<LoginPage />);
const usernameInput = getByLabelText('username') as HTMLInputElement;
Expand Down

0 comments on commit 63073c9

Please sign in to comment.