diff --git a/src/components/ChatBox/index.test.jsx b/src/components/ChatBox/index.test.jsx
index cc78c2d1..a2f0a38a 100644
--- a/src/components/ChatBox/index.test.jsx
+++ b/src/components/ChatBox/index.test.jsx
@@ -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'),
@@ -52,7 +47,7 @@ describe('', () => {
};
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', () => {
@@ -65,7 +60,7 @@ describe('', () => {
};
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', () => {
@@ -78,7 +73,7 @@ describe('', () => {
};
render(undefined, sliceState);
- expect(screen.getByText('Today')).toBeInTheDocument();
+ expect(screen.queryByTestId('today-divider')).toBeInTheDocument();
});
// todo: correctly divides old and new messages, check order
@@ -92,6 +87,6 @@ describe('', () => {
};
render(undefined, sliceState);
- expect(screen.getByText('Today')).toBeInTheDocument();
+ expect(screen.queryByTestId('today-divider')).toBeInTheDocument();
});
});