diff --git a/packages/snaps-sdk/src/jsx/validation.test.tsx b/packages/snaps-sdk/src/jsx/validation.test.tsx index 9cb0c285ef..e1190dafda 100644 --- a/packages/snaps-sdk/src/jsx/validation.test.tsx +++ b/packages/snaps-sdk/src/jsx/validation.test.tsx @@ -61,11 +61,11 @@ import { } from './validation'; describe('KeyStruct', () => { - it.each(['foo', 42])('validates a key', (value) => { + it.each(['foo', 'bar'])('validates a key', (value) => { expect(is(value, KeyStruct)).toBe(true); }); - it.each([null, undefined, {}, []])('does not validate "%p"', (value) => { + it.each([42, null, undefined, {}, []])('does not validate "%p"', (value) => { expect(is(value, KeyStruct)).toBe(false); }); }); diff --git a/packages/snaps-sdk/src/jsx/validation.ts b/packages/snaps-sdk/src/jsx/validation.ts index 73cfdf101e..e7b026a95f 100644 --- a/packages/snaps-sdk/src/jsx/validation.ts +++ b/packages/snaps-sdk/src/jsx/validation.ts @@ -68,7 +68,7 @@ import type { /** * A struct for the {@link Key} type. */ -export const KeyStruct: Describe = nullUnion([string()]); +export const KeyStruct: Describe = string(); /** * A struct for the {@link StringElement} type.