From cec3bf8a73bad2f0fe9092c7cf0d56869f5b981a Mon Sep 17 00:00:00 2001 From: Robert Baillie Date: Wed, 16 Mar 2022 11:10:16 +0000 Subject: [PATCH] Fixed unit tests with literal strings for the prefix on errors --- .../errorRenderer/__tests__/errorRenderer.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/framework/default/ortoo-core/default/lwc/errorRenderer/__tests__/errorRenderer.test.js b/framework/default/ortoo-core/default/lwc/errorRenderer/__tests__/errorRenderer.test.js index 8bd42af27d0..5d688137293 100644 --- a/framework/default/ortoo-core/default/lwc/errorRenderer/__tests__/errorRenderer.test.js +++ b/framework/default/ortoo-core/default/lwc/errorRenderer/__tests__/errorRenderer.test.js @@ -29,7 +29,7 @@ describe('displayError', () => { const dispatchedEvent = objectToRunAgainst.dispatchEvent.mock.calls[0][0]; expect( dispatchedEvent.detail.title ).toBe( 'c.ortoo_core_error_title' ); - expect( dispatchedEvent.detail.message ).toBe( error ); + expect( dispatchedEvent.detail.message ).toBe( 'Your action could not be completed: ' + error ); expect( dispatchedEvent.detail.variant ).toBe( 'error' ); expect( dispatchedEvent.detail.mode ).toBe( 'sticky' ); @@ -58,7 +58,7 @@ describe('displayError', () => { const dispatchedEvent = objectToRunAgainst.dispatchEvent.mock.calls[0][0]; expect( dispatchedEvent.detail.title ).toBe( 'c.ortoo_core_error_title' ); - expect( dispatchedEvent.detail.message ).toBe( 'javascript error format' ); + expect( dispatchedEvent.detail.message ).toBe( 'Your action could not be completed: javascript error format' ); expect( dispatchedEvent.detail.variant ).toBe( 'error' ); expect( dispatchedEvent.detail.mode ).toBe( 'sticky' ); @@ -89,7 +89,7 @@ describe('displayError', () => { const dispatchedEvent = objectToRunAgainst.dispatchEvent.mock.calls[0][0]; expect( dispatchedEvent.detail.title ).toBe( 'c.ortoo_core_error_title' ); - expect( dispatchedEvent.detail.message ).toBe( 'An error message in the body' ); + expect( dispatchedEvent.detail.message ).toBe( 'Your action could not be completed: An error message in the body' ); expect( dispatchedEvent.detail.variant ).toBe( 'error' ); expect( dispatchedEvent.detail.mode ).toBe( 'sticky' ); @@ -149,7 +149,7 @@ describe('displayError', () => { const dispatchedEvent = objectToRunAgainst.dispatchEvent.mock.calls[0][0]; expect( dispatchedEvent.detail.title ).toBe( 'c.ortoo_core_error_title' ); - expect( dispatchedEvent.detail.message ).toBe( 'An error string' ); + expect( dispatchedEvent.detail.message ).toBe( 'Your action could not be completed: An error string' ); expect( dispatchedEvent.detail.variant ).toBe( 'warning' ); expect( dispatchedEvent.detail.mode ).toBe( 'sticky' ); @@ -179,7 +179,7 @@ describe('displayError', () => { const dispatchedEvent = objectToRunAgainst.dispatchEvent.mock.calls[0][0]; expect( dispatchedEvent.detail.title ).toBe( options.title ); - expect( dispatchedEvent.detail.message ).toBe( error ); + expect( dispatchedEvent.detail.message ).toBe( 'Your action could not be completed: ' + error ); expect( dispatchedEvent.detail.variant ).toBe( 'error' ); expect( dispatchedEvent.detail.mode ).toBe( 'sticky' ); @@ -209,7 +209,7 @@ describe('displayError', () => { const dispatchedEvent = objectToRunAgainst.dispatchEvent.mock.calls[0][0]; expect( dispatchedEvent.detail.title ).toBe( 'c.ortoo_core_error_title' ); - expect( dispatchedEvent.detail.message ).toBe( 'An error string' ); + expect( dispatchedEvent.detail.message ).toBe( 'Your action could not be completed: An error string' ); expect( dispatchedEvent.detail.variant ).toBe( 'error' ); expect( dispatchedEvent.detail.mode ).toBe( 'pester' );