Skip to content

Commit 9bad0bb

Browse files
chore: remove ThemeProvider from stories (#7028)
1 parent ca6d60d commit 9bad0bb

File tree

13 files changed

+689
-839
lines changed

13 files changed

+689
-839
lines changed

packages/react/src/ActionList/Group.test.tsx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
import {describe, it, expect, vi} from 'vitest'
22
import {render as HTMLRender} from '@testing-library/react'
3-
import theme from '../theme'
43
import {ActionList} from '.'
5-
import {BaseStyles, ThemeProvider, ActionMenu} from '..'
4+
import {BaseStyles, ActionMenu} from '..'
65

76
describe('ActionList.Group', () => {
87
it('should throw an error when ActionList.GroupHeading has an `as` prop when it is used within ActionMenu context', async () => {
98
const spy = vi.spyOn(console, 'error').mockImplementation(() => vi.fn())
109
expect(() =>
1110
HTMLRender(
12-
<ThemeProvider theme={theme}>
13-
<BaseStyles>
14-
<ActionMenu open={true}>
15-
<ActionMenu.Button>Trigger</ActionMenu.Button>
16-
<ActionMenu.Overlay>
17-
<ActionList>
18-
<ActionList.Group>
19-
<ActionList.GroupHeading as="h2">Group Heading</ActionList.GroupHeading>
20-
</ActionList.Group>
21-
</ActionList>
22-
</ActionMenu.Overlay>
23-
</ActionMenu>
24-
</BaseStyles>
25-
</ThemeProvider>,
11+
<BaseStyles>
12+
<ActionMenu open={true}>
13+
<ActionMenu.Button>Trigger</ActionMenu.Button>
14+
<ActionMenu.Overlay>
15+
<ActionList>
16+
<ActionList.Group>
17+
<ActionList.GroupHeading as="h2">Group Heading</ActionList.GroupHeading>
18+
</ActionList.Group>
19+
</ActionList>
20+
</ActionMenu.Overlay>
21+
</ActionMenu>
22+
</BaseStyles>,
2623
),
2724
).toThrow(
2825
"Looks like you are trying to set a heading level to a menu role. Group headings for menu type action lists are for representational purposes, and rendered as divs. Therefore they don't need a heading level.",

packages/react/src/ActionList/Heading.test.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import {describe, it, expect, vi} from 'vitest'
22
import {render as HTMLRender} from '@testing-library/react'
3-
import theme from '../theme'
43
import {ActionList} from '.'
5-
import {BaseStyles, ThemeProvider, ActionMenu} from '..'
4+
import {BaseStyles, ActionMenu} from '..'
65

76
describe('ActionList.Heading', () => {
87
it('should render the ActionList.Heading component as a heading with the given heading level', async () => {
@@ -32,19 +31,17 @@ describe('ActionList.Heading', () => {
3231
const spy = vi.spyOn(console, 'error').mockImplementation(() => vi.fn())
3332
expect(() =>
3433
HTMLRender(
35-
<ThemeProvider theme={theme}>
36-
<BaseStyles>
37-
<ActionMenu open={true}>
38-
<ActionMenu.Button>Trigger</ActionMenu.Button>
39-
<ActionMenu.Overlay>
40-
<ActionList>
41-
<ActionList.Heading as="h1">Heading</ActionList.Heading>
42-
<ActionList.Item>Item</ActionList.Item>
43-
</ActionList>
44-
</ActionMenu.Overlay>
45-
</ActionMenu>
46-
</BaseStyles>
47-
</ThemeProvider>,
34+
<BaseStyles>
35+
<ActionMenu open={true}>
36+
<ActionMenu.Button>Trigger</ActionMenu.Button>
37+
<ActionMenu.Overlay>
38+
<ActionList>
39+
<ActionList.Heading as="h1">Heading</ActionList.Heading>
40+
<ActionList.Item>Item</ActionList.Item>
41+
</ActionList>
42+
</ActionMenu.Overlay>
43+
</ActionMenu>
44+
</BaseStyles>,
4845
),
4946
).toThrow(
5047
"ActionList.Heading shouldn't be used within an ActionMenu container. Menus are labelled by the menu button's name.",

0 commit comments

Comments
 (0)