From 6d9c4e40b54f8882329374c1e8b3d036a0161846 Mon Sep 17 00:00:00 2001 From: david0xd Date: Thu, 24 Oct 2024 13:21:25 +0200 Subject: [PATCH] Add one more struct test --- packages/snaps-simulation/src/structs.test.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/snaps-simulation/src/structs.test.tsx b/packages/snaps-simulation/src/structs.test.tsx index 2d0fa71c15..702170a925 100644 --- a/packages/snaps-simulation/src/structs.test.tsx +++ b/packages/snaps-simulation/src/structs.test.tsx @@ -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();