Skip to content

Commit

Permalink
Fix tests for Key
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtenz committed Jul 6, 2024
1 parent 00c2081 commit aba6054
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/snaps-sdk/src/jsx/validation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-sdk/src/jsx/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import type {
/**
* A struct for the {@link Key} type.
*/
export const KeyStruct: Describe<Key> = nullUnion([string()]);
export const KeyStruct: Describe<Key> = string();

/**
* A struct for the {@link StringElement} type.
Expand Down

0 comments on commit aba6054

Please sign in to comment.