From cfbf8967ad797dfb529b4ff7c1e13e458350d866 Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Fri, 15 Nov 2024 13:27:28 +0100 Subject: [PATCH] UIQM-730 fix tests --- src/QuickMarcEditor/QuickMarcEditor.js | 2 +- src/QuickMarcEditor/QuickMarcEditor.test.js | 24 ++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/QuickMarcEditor/QuickMarcEditor.js b/src/QuickMarcEditor/QuickMarcEditor.js index 4bbdbe97..0e1a04d0 100644 --- a/src/QuickMarcEditor/QuickMarcEditor.js +++ b/src/QuickMarcEditor/QuickMarcEditor.js @@ -235,7 +235,7 @@ const QuickMarcEditor = ({ const values = { warnCount, failCount, - breakingLine:
, + breakingLine:
, }; let messageId = null; diff --git a/src/QuickMarcEditor/QuickMarcEditor.test.js b/src/QuickMarcEditor/QuickMarcEditor.test.js index aa531d15..edc89a62 100644 --- a/src/QuickMarcEditor/QuickMarcEditor.test.js +++ b/src/QuickMarcEditor/QuickMarcEditor.test.js @@ -820,14 +820,14 @@ describe('Given QuickMarcEditor', () => { it('should show a toast notification about validation error', async () => { await waitFor(() => { - expect(mockShowCallout).toHaveBeenCalledWith({ + expect(mockShowCallout).toHaveBeenCalledWith(expect.objectContaining({ messageId: 'ui-quick-marc.record.save.error.fail', - values: { + values: expect.objectContaining({ failCount: 1, warnCount: 0, - }, + }), type: 'error', - }); + })); }); }); }); @@ -849,14 +849,14 @@ describe('Given QuickMarcEditor', () => { it('should show a toast notification about validation warning', async () => { await waitFor(() => { - expect(mockShowCallout).toHaveBeenCalledWith({ + expect(mockShowCallout).toHaveBeenCalledWith(expect.objectContaining({ messageId: 'ui-quick-marc.record.save.error.warn', - values: { + values: expect.objectContaining({ failCount: 0, warnCount: 1, - }, + }), type: 'warning', - }); + })); }); }); }); @@ -883,14 +883,14 @@ describe('Given QuickMarcEditor', () => { it('should show a toast notification about validation warning and error', async () => { await waitFor(() => { - expect(mockShowCallout).toHaveBeenCalledWith({ + expect(mockShowCallout).toHaveBeenCalledWith(expect.objectContaining({ messageId: 'ui-quick-marc.record.save.error.failAndWarn', - values: { + values: expect.objectContaining({ failCount: 1, warnCount: 1, - }, + }), type: 'error', - }); + })); }); }); });