diff --git a/src/story.test.ts b/src/story.test.ts index 8d730c2..38bbc59 100644 --- a/src/story.test.ts +++ b/src/story.test.ts @@ -57,6 +57,25 @@ const strict: XMeta = { argTypes: { x: { type: { name: 'string' } } }, }; +const options = ['foo', 'bar'] as const; +const simpleWithReadonlyOptions: XMeta = { + title: 'simple', + component: Button, + tags: ['foo', 'bar'], + decorators: [(storyFn, context) => `withDecorator(${storyFn(context)})`], + parameters: { a: () => null, b: NaN, c: Symbol('symbol') }, + loaders: [() => Promise.resolve({ d: '3' })], + args: { x: '1' }, + argTypes: { + x: { + control: { + type: 'select', + }, + options, + }, + }, +}; + // NOTE Various story usages const Simple: XStory = () => 'Simple'; diff --git a/src/story.ts b/src/story.ts index 551f6a3..aa9c596 100644 --- a/src/story.ts +++ b/src/story.ts @@ -131,7 +131,7 @@ export interface InputType { /** * @see https://storybook.js.org/docs/api/arg-types#options */ - options?: any[]; + options?: readonly any[]; /** * @see https://storybook.js.org/docs/api/arg-types#table */