chore: enable no-console eslint rule for tests and stories (#4816)
Re-enables no-console eslint rule in stories and tests files: - In stories, use `action` from '@storybook/addon-actions' or `fn` from '@storybook/test' instead of console. - In tests, console methods can be mocked like this: `global.console.error = jest.fn()`.
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { useEffect } from 'react';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { Meta, StoryObj } from '@storybook/react';
|
||||
import { expect, userEvent, within } from '@storybook/test';
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
@ -46,8 +47,7 @@ const meta: Meta<typeof CommandMenu> = {
|
||||
label: 'Create Task',
|
||||
type: CommandType.Create,
|
||||
Icon: IconCheckbox,
|
||||
// eslint-disable-next-line no-console
|
||||
onCommandClick: () => console.log('create task click'),
|
||||
onCommandClick: action('create task click'),
|
||||
},
|
||||
{
|
||||
id: 'create-note',
|
||||
@ -55,8 +55,7 @@ const meta: Meta<typeof CommandMenu> = {
|
||||
label: 'Create Note',
|
||||
type: CommandType.Create,
|
||||
Icon: IconNotes,
|
||||
// eslint-disable-next-line no-console
|
||||
onCommandClick: () => console.log('create note click'),
|
||||
onCommandClick: action('create note click'),
|
||||
},
|
||||
]);
|
||||
openCommandMenu();
|
||||
|
||||
Reference in New Issue
Block a user