Skip to content

Commit fadfd4c

Browse files
authored
Update deps (#1986)
1 parent 9f16962 commit fadfd4c

136 files changed

Lines changed: 8494 additions & 10622 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* @type {import("eslint").Linter.Config}
33
*/
44
module.exports = {
5+
ignorePatterns: ['next-env.d.ts'],
56
extends: [
67
'plugin:@typescript-eslint/eslint-recommended',
78
'plugin:react/recommended',
@@ -167,7 +168,7 @@ module.exports = {
167168
'vitest/consistent-test-it': ['error', { fn: 'it', withinDescribe: 'it' }],
168169
'vitest/expect-expect': [
169170
'error',
170-
{ assertFunctionNames: ['expect', 'createShallowSnapshotTest', 'createSnapshotTest'] },
171+
{ assertFunctionNames: ['expect', 'createSnapshotTest'] },
171172
],
172173
'vitest/prefer-lowercase-title': ['error', { ignore: ['describe'] }],
173174
'vitest/no-test-prefixes': 'error',

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22
1+
24

.storybook/OCTheme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { create } from '@storybook/theming/create';
1+
import { create } from 'storybook/theming/create';
22

33
export default create({
44
base: 'dark',

.storybook/main.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const svgoConfig = require('../common/config/svgo');
1+
import svgoConfig from '../common/config/svgo';
22
import type { StorybookConfig } from '@storybook/nextjs';
33

44
const config: StorybookConfig = {
@@ -7,14 +7,11 @@ const config: StorybookConfig = {
77
'../components/**/__stories__/*.stories.@(js|jsx|mjs|ts|tsx)',
88
],
99
staticDirs: ['../public'],
10-
addons: [
11-
'@storybook/addon-essentials',
12-
{
13-
name: '@storybook/addon-styling',
14-
/** @see https://storybook.js.org/recipes/tailwindcss#:~:text=then%20leave%20the%20options%20object%20empty. */
15-
options: {},
16-
},
17-
],
10+
addons: ['@storybook/addon-docs'],
11+
framework: {
12+
name: '@storybook/nextjs',
13+
options: {},
14+
},
1815
webpackFinal: async config => {
1916
// Find the Storybook Webpack rule relevant to SVG files.
2017
// @ts-expect-error => 'config.module' is possibly 'undefined'.ts(18048)
@@ -48,13 +45,6 @@ const config: StorybookConfig = {
4845

4946
return config;
5047
},
51-
framework: {
52-
name: '@storybook/nextjs',
53-
options: {},
54-
},
55-
docs: {
56-
autodocs: true,
57-
},
5848
};
5949

6050
export default config;

.storybook/manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addons } from '@storybook/addons';
1+
import { addons } from 'storybook/manager-api';
22
import OCTheme from './OCTheme';
33

44
addons.setConfig({

.storybook/preview.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'common/styles/globals.css';
2-
import * as viewports from '@storybook/addon-viewport';
2+
import { MINIMAL_VIEWPORTS, INITIAL_VIEWPORTS } from 'storybook/viewport';
33

44
export const decorators = [
55
Story => (
@@ -9,13 +9,14 @@ export const decorators = [
99
),
1010
];
1111

12+
export const tags = ['autodocs'];
13+
1214
const preview = {
1315
parameters: {
14-
actions: { argTypesRegex: '^on[A-Z].*' },
1516
viewport: {
1617
viewports: {
17-
...viewports.MINIMAL_VIEWPORTS,
18-
...viewports.INITIAL_VIEWPORTS,
18+
...MINIMAL_VIEWPORTS,
19+
...INITIAL_VIEWPORTS,
1920
},
2021
},
2122
},

components/Accordion/__stories__/Accordion.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Meta, StoryObj } from '@storybook/react';
1+
import type { Meta, StoryObj } from '@storybook/nextjs';
22
import Accordion from '../Accordion';
33

44
type AccordionStoryType = StoryObj<typeof Accordion>;

components/Accordion/__tests__/Accordion.test.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
import { fireEvent, render } from '@testing-library/react';
2-
import { composeStory } from '@storybook/react';
32
import {
43
ACCORDION_CONTENT,
54
ACCORDION_TOGGLE_BUTTON,
65
SCREEN_READER_ONLY,
76
} from 'common/constants/testIDs';
87
import { toggleMessages } from '../../ScreenReaderOnly/ScreenReaderOnly';
9-
import meta, { Default } from '../__stories__/Accordion.stories';
8+
import Accordion from '../Accordion';
109

11-
const AccordionStory = composeStory(Default, meta);
10+
const defaultProps = {
11+
accessibilityId: '1',
12+
content: {
13+
headingChildren: <h5>Can be JSX</h5>,
14+
bodyChildren: <p>Can also be JSX</p>,
15+
},
16+
};
1217

1318
describe('Accordion', () => {
1419
it('should render invisible text that turns visible on toggle click', async () => {
15-
const component = render(<AccordionStory />);
20+
const component = render(<Accordion {...defaultProps} />);
1621
const Content = component.queryByTestId(ACCORDION_CONTENT);
1722

1823
expect(Content?.classList.contains('hidden')).toBe(true);
@@ -25,7 +30,7 @@ describe('Accordion', () => {
2530

2631
describe('Accordion Accessibility', () => {
2732
it('should display the correct screenReader text for toggle button', async () => {
28-
const component = render(<AccordionStory />);
33+
const component = render(<Accordion {...defaultProps} />);
2934
const Button = component.queryByTestId(SCREEN_READER_ONLY)!;
3035

3136
expect(Button.textContent).toBe(toggleMessages.open);

components/Alert/__stories__/Alert.stories.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
import type { Meta, StoryObj } from '@storybook/react';
1+
import type { Meta, StoryObj } from '@storybook/nextjs';
2+
import { fn } from 'storybook/test';
23
import Alert from '../Alert';
34

45
type AlertStoryType = StoryObj<typeof Alert>;
56

67
const meta: Meta<typeof Alert> = {
78
title: 'Alert',
89
component: Alert,
10+
args: {
11+
onClose: fn(),
12+
},
913
};
1014

1115
export default meta;

components/Alert/__tests__/Alert.test.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
import { fireEvent, render } from '@testing-library/react';
2-
import { composeStory } from '@storybook/react';
32
import createSnapshotTest from 'test-utils/createSnapshotTest';
43
import { ALERT_CLOSE_BUTTON } from 'common/constants/testIDs';
5-
import meta, { ErrorAlert, SuccessAlert, WarningAlert } from '../__stories__/Alert.stories';
6-
7-
const ErrorAlertStory = composeStory(ErrorAlert, meta);
8-
const SuccessAlertStory = composeStory(SuccessAlert, meta);
9-
const WarningAlertStory = composeStory(WarningAlert, meta);
4+
import Alert from '../Alert';
105

116
describe('Alert', () => {
127
it('should render error alert with required props', () => {
13-
createSnapshotTest(<ErrorAlertStory />);
8+
createSnapshotTest(<Alert type="error">Error Alert JSX or Text</Alert>);
149
});
1510

1611
it('should call close handler when close alert button clicked', () => {
1712
const onCloseMock = vi.fn();
1813

19-
const { queryByTestId } = render(<SuccessAlertStory onClose={onCloseMock} />);
14+
const { queryByTestId } = render(
15+
<Alert type="success" onClose={onCloseMock}>
16+
Success Alert JSX or Text
17+
</Alert>,
18+
);
2019

2120
expect(onCloseMock).toHaveBeenCalledTimes(0);
2221

@@ -26,7 +25,7 @@ describe('Alert', () => {
2625
});
2726

2827
it('should NOT render button if close handler not provided', () => {
29-
const { queryByTestId } = render(<WarningAlertStory />);
28+
const { queryByTestId } = render(<Alert type="warning">Warning Alert JSX or Text</Alert>);
3029

3130
expect(queryByTestId(ALERT_CLOSE_BUTTON)).toBeNull();
3231
});

0 commit comments

Comments
 (0)