Skip to content

Commit

Permalink
add unit tests for multiple merchant ids
Browse files Browse the repository at this point in the history
  • Loading branch information
surekhaw committed Oct 3, 2023
1 parent f266100 commit 4ded2eb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/unit/spec/src/zoid/message/validation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ describe('validate', () => {
expect(merchantId).toEqual(merchantId);
expect(console.warn).not.toHaveBeenCalled();

merchantId = validate.merchantId({ props: { merchantId: 'DEV00000000NI,DEV00000001NI' } });
expect(merchantId).toEqual(merchantId);
expect(console.warn).not.toHaveBeenCalled();

merchantId = validate.merchantId({ props: { merchantId: 'DEV00000000,DEV00000001NI' } });

expect(merchantId).toBeUndefined();
expect(console.warn).toHaveBeenCalledTimes(1);
expect(console.warn).toHaveBeenLastCalledWith(
expect.stringContaining('invalid_option_value'),
expect.objectContaining({ location: 'merchantId' })
);

merchantId = validate.merchantId({ props: { merchantId: 'client-id:test_client_id' } });

expect(merchantId).toBeUndefined();
Expand Down

0 comments on commit 4ded2eb

Please sign in to comment.