Skip to content

Commit 0c216b6

Browse files
committed
test: add test "should not submit the message if content not change"
1 parent 99f153a commit 0c216b6

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/components/MessageInput/__tests__/EditMessageForm.test.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ describe(`EditMessageForm`, () => {
822822
});
823823

824824
describe('Submitting', () => {
825-
it('should submit the message if content not change', async () => {
825+
it('should not submit the message if content not change', async () => {
826826
const { customChannel, customClient } = await setup();
827827
const { container, submit } = await renderComponent({
828828
customChannel,
@@ -831,13 +831,7 @@ describe(`EditMessageForm`, () => {
831831

832832
await act(() => submit());
833833

834-
expect(editMock).toHaveBeenCalledWith(
835-
customChannel.cid,
836-
expect.objectContaining({
837-
text: mainListMessage.text,
838-
}),
839-
{},
840-
);
834+
expect(editMock).not.toHaveBeenCalled();
841835
await axeNoViolations(container);
842836
});
843837
it('should submit the input value with text changed', async () => {

0 commit comments

Comments
 (0)