diff --git a/src/features/AdminPage/TagsPage/TagsPage/TagAdminModal.component.spec.tsx b/src/features/AdminPage/TagsPage/TagsPage/TagAdminModal.component.spec.tsx index 8d3ff32c3..569dda210 100644 --- a/src/features/AdminPage/TagsPage/TagsPage/TagAdminModal.component.spec.tsx +++ b/src/features/AdminPage/TagsPage/TagsPage/TagAdminModal.component.spec.tsx @@ -18,6 +18,7 @@ jest.mock("antd", () => { success: jest.fn(), config: jest.fn(), error: jest.fn(), + open: jest.fn(), } } }) @@ -139,8 +140,13 @@ describe("PartnerModal", () => { }); await waitFor(() => { - expect(message.error).toHaveBeenCalled(); - }) + expect(message.open).toHaveBeenCalled(); + }); + + const [call] = (message.open as jest.Mock).mock.calls; + const { content } = call[0]; + expect(content).toBeDefined(); + expect((content as React.ReactElement).props.className).toMatch(/error/); cleanup(); }) @@ -157,8 +163,13 @@ describe("PartnerModal", () => { }); await waitFor(() => { - expect(message.error).toHaveBeenCalled(); - }) + expect(message.open).toHaveBeenCalled(); + }); + + const [call] = (message.open as jest.Mock).mock.calls; + const { content } = call[0]; + expect(content).toBeDefined(); + expect((content as React.ReactElement).props.className).toMatch(/error/); cleanup(); }) diff --git a/src/features/AdminPage/TagsPage/TagsPage/TagAdminModal.tsx b/src/features/AdminPage/TagsPage/TagsPage/TagAdminModal.tsx index 45393d3aa..364613403 100644 --- a/src/features/AdminPage/TagsPage/TagsPage/TagAdminModal.tsx +++ b/src/features/AdminPage/TagsPage/TagsPage/TagAdminModal.tsx @@ -98,7 +98,7 @@ const SourceModal: React.FC = ({ const messageText = "Будь ласка, заповніть всі обов'язкові поля та перевірте валідність ваших даних"; message.open({ content: ( -
+
{messageText}
),