Skip to content

Commit

Permalink
test: cleanup imports
Browse files Browse the repository at this point in the history
  • Loading branch information
varshamenon4 committed Nov 21, 2024
1 parent 214326f commit f5afc5d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/components/ChatBox/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import { initialState } from '../../data/slice';

import ChatBox from '.';

const mockedAuthenticatedUser = { userId: 123 };
jest.mock('@edx/frontend-platform/auth', () => ({
getAuthenticatedUser: () => mockedAuthenticatedUser,
}));

const mockDispatch = jest.fn();
jest.mock('react-redux', () => ({
...jest.requireActual('react-redux'),
Expand Down Expand Up @@ -52,7 +47,7 @@ describe('<ChatBox />', () => {
};
render(undefined, sliceState);

expect(screen.getByText('Today')).not.toBeInTheDocument();
expect(screen.queryByTestId('today-divider')).not.toBeInTheDocument();
});

it('message divider does not appear when all messages from today', () => {
Expand All @@ -65,7 +60,7 @@ describe('<ChatBox />', () => {
};
render(undefined, sliceState);

expect(screen.getByText('Today')).not.toBeInTheDocument();
expect(screen.queryByTestId('today-divider')).not.toBeInTheDocument();
});

it('message divider shows when all messages from before today', () => {
Expand All @@ -78,7 +73,7 @@ describe('<ChatBox />', () => {
};
render(undefined, sliceState);

expect(screen.getByText('Today')).toBeInTheDocument();
expect(screen.queryByTestId('today-divider')).toBeInTheDocument();
});

// todo: correctly divides old and new messages, check order
Expand All @@ -92,6 +87,6 @@ describe('<ChatBox />', () => {
};
render(undefined, sliceState);

expect(screen.getByText('Today')).toBeInTheDocument();
expect(screen.queryByTestId('today-divider')).toBeInTheDocument();
});
});

0 comments on commit f5afc5d

Please sign in to comment.