Skip to content

Commit

Permalink
Minor improvement to uriUtils test to check console.error output
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-baillie-ortoo committed Feb 16, 2022
1 parent f392e92 commit 66303ff
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ describe( 'getUriFragmentAsObject', () => {
})
it( 'will skip values that do not decode properly', () => {

console.error = jest.fn()

location.hash = 'property1=%22value1%22&invalid=%22incompleteJson&property2=%22value2%22';

const expected = {
Expand All @@ -173,6 +175,8 @@ describe( 'getUriFragmentAsObject', () => {
const got = UriUtils.getUriFragmentAsObject();

expect( got ).toEqual( expected );
expect( console.error ).toHaveBeenCalled();
expect( console.error ).toHaveBeenCalledWith( 'Invalid parameter value in URI fragment' );
})
});

Expand Down

0 comments on commit 66303ff

Please sign in to comment.