Skip to content

Commit

Permalink
Add one more struct test
Browse files Browse the repository at this point in the history
  • Loading branch information
david0xd committed Oct 24, 2024
1 parent dbe0860 commit 6d9c4e4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/snaps-simulation/src/structs.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,17 @@ describe('NameLookupOptionsStruct', () => {
});
});

it('throws when trying to use both, address and domain', () => {
const options = {
chainId: 'eip155:1',
address: '0xc0ffee254729296a45a3885639AC7E10F9d54979',
domain: 'test.domain',
};
expect(() => create(options, NameLookupOptionsStruct)).toThrow(
'Expected the value to satisfy a union of `object | object`, but received: [object Object]',
);
});

it.each(INVALID_VALUES)('throws for invalid value: %p', (value) => {
// eslint-disable-next-line jest/require-to-throw-message
expect(() => create(value, NameLookupOptionsStruct)).toThrow();
Expand Down

0 comments on commit 6d9c4e4

Please sign in to comment.