From 2fff6b9c07895ceabaf0c29389626dfcb0c1e5ac Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Fri, 1 Nov 2024 15:35:55 +0100 Subject: [PATCH] update tests --- tests/integrations/flat-config.spec.ts | 3 ++- tests/integrations/flat-config/a.stories.tsx | 6 ++---- tests/integrations/flat-config/eslint.config.js | 1 + tests/integrations/legacy-config.spec.ts | 3 ++- tests/integrations/legacy-config/.eslintrc.json | 3 ++- tests/integrations/legacy-config/a.stories.tsx | 6 ++---- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/integrations/flat-config.spec.ts b/tests/integrations/flat-config.spec.ts index 8a9f43e..2aad67a 100644 --- a/tests/integrations/flat-config.spec.ts +++ b/tests/integrations/flat-config.spec.ts @@ -30,11 +30,12 @@ describe('Integration with flat config', () => { } const result = JSON.parse( - cp.execSync(`${ESLINT} a.stories.tsx --max-warnings 1 --format=json`, { + cp.execSync(`${ESLINT} a.stories.tsx --max-warnings 2 --format=json`, { encoding: 'utf-8', }) ) expect(result.length).toBe(1) expect(result[0].messages[0].messageId).toBe('shouldHaveStoryExport') + expect(result[0].messages[1].messageId).toBe('metaShouldHaveInlineProperties') }) }) diff --git a/tests/integrations/flat-config/a.stories.tsx b/tests/integrations/flat-config/a.stories.tsx index 0d5133e..b07c30c 100644 --- a/tests/integrations/flat-config/a.stories.tsx +++ b/tests/integrations/flat-config/a.stories.tsx @@ -1,6 +1,4 @@ const Input = () => 'This is an input component' -export default { - title: 'Input', - component: Input, -} +const title = 'foo'; +export default { title } diff --git a/tests/integrations/flat-config/eslint.config.js b/tests/integrations/flat-config/eslint.config.js index 02feb2c..e584222 100644 --- a/tests/integrations/flat-config/eslint.config.js +++ b/tests/integrations/flat-config/eslint.config.js @@ -6,6 +6,7 @@ export default [ files: ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '**/*.story.@(ts|tsx|js|jsx|mjs|cjs)'], rules: { 'storybook/story-exports': 'warn', + 'storybook/meta-inline-properties': 'warn', }, }, ] diff --git a/tests/integrations/legacy-config.spec.ts b/tests/integrations/legacy-config.spec.ts index f441480..2bb9e8c 100644 --- a/tests/integrations/legacy-config.spec.ts +++ b/tests/integrations/legacy-config.spec.ts @@ -30,11 +30,12 @@ describe('Integration with legacy config', () => { } const result = JSON.parse( - cp.execSync(`${ESLINT} a.stories.tsx --max-warnings 1 --format=json`, { + cp.execSync(`${ESLINT} a.stories.tsx --max-warnings 2 --format=json`, { encoding: 'utf-8', }) ) expect(result.length).toBe(1) expect(result[0].messages[0].messageId).toBe('shouldHaveStoryExport') + expect(result[0].messages[1].messageId).toBe('metaShouldHaveInlineProperties') }) }) diff --git a/tests/integrations/legacy-config/.eslintrc.json b/tests/integrations/legacy-config/.eslintrc.json index 171b300..2c0fa80 100644 --- a/tests/integrations/legacy-config/.eslintrc.json +++ b/tests/integrations/legacy-config/.eslintrc.json @@ -9,7 +9,8 @@ { "files": ["*.stories.@(ts|tsx|js|jsx|mjs|cjs)"], "rules": { - "storybook/story-exports": "warn" + "storybook/story-exports": "warn", + "storybook/meta-inline-properties": "warn" } } ] diff --git a/tests/integrations/legacy-config/a.stories.tsx b/tests/integrations/legacy-config/a.stories.tsx index 0d5133e..b07c30c 100644 --- a/tests/integrations/legacy-config/a.stories.tsx +++ b/tests/integrations/legacy-config/a.stories.tsx @@ -1,6 +1,4 @@ const Input = () => 'This is an input component' -export default { - title: 'Input', - component: Input, -} +const title = 'foo'; +export default { title }