Skip to content

Commit

Permalink
Fixed unit tests with literal strings for the prefix on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-baillie-ortoo committed Mar 16, 2022
1 parent 37801e0 commit cec3bf8
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

Expand Down Expand Up @@ -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' );

Expand Down Expand Up @@ -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' );

Expand Down Expand Up @@ -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' );

Expand Down Expand Up @@ -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' );

Expand Down Expand Up @@ -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' );

Expand Down

0 comments on commit cec3bf8

Please sign in to comment.