Skip to content

Commit 2161f9f

Browse files
committed
tests
1 parent 20f637d commit 2161f9f

File tree

5 files changed

+28
-22
lines changed

5 files changed

+28
-22
lines changed

src/__tests__/ActionMenu.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ describe('ActionMenu', () => {
4242
Component: ActionMenu,
4343
systemPropArray: [COMMON],
4444
options: {skipAs: true, skipSx: true},
45-
toRender: () => <ActionMenu items={[]} />
45+
toRender: () => (
46+
<SSRProvider>
47+
<ActionMenu items={[]} />
48+
</SSRProvider>
49+
)
4650
})
4751

4852
checkExports('ActionMenu', {

src/__tests__/DropdownMenu.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import theme from '../theme'
66
import {DropdownMenu, DropdownButton} from '../DropdownMenu'
77
import {COMMON} from '../constants'
88
import {behavesAsComponent, checkExports} from '../utils/testing'
9-
import {BaseStyles, ThemeProvider} from '..'
9+
import {BaseStyles, ThemeProvider, SSRProvider} from '..'
1010
import {ItemInput} from '../ActionList/List'
1111

1212
expect.extend(toHaveNoViolations)
@@ -18,16 +18,18 @@ function SimpleDropdownMenu(): JSX.Element {
1818

1919
return (
2020
<ThemeProvider theme={theme}>
21-
<BaseStyles>
22-
<div id="something-else">X</div>
23-
<DropdownMenu
24-
items={items}
25-
placeholder="Select an Option"
26-
selectedItem={selectedItem}
27-
onChange={setSelectedItem}
28-
/>
29-
<div id="portal-root"></div>
30-
</BaseStyles>
21+
<SSRProvider>
22+
<BaseStyles>
23+
<div id="something-else">X</div>
24+
<DropdownMenu
25+
items={items}
26+
placeholder="Select an Option"
27+
selectedItem={selectedItem}
28+
onChange={setSelectedItem}
29+
/>
30+
<div id="portal-root"></div>
31+
</BaseStyles>
32+
</SSRProvider>
3133
</ThemeProvider>
3234
)
3335
}

src/__tests__/__snapshots__/ActionMenu.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ exports[`ActionMenu renders consistently 1`] = `
7070
<button
7171
aria-haspopup="true"
7272
aria-label="menu"
73-
aria-labelledby="react-aria-4612506814-1"
73+
aria-labelledby="react-aria-0-1"
7474
className="c0"
75-
id="react-aria-4612506814-1"
75+
id="react-aria-0-1"
7676
onClick={[Function]}
7777
onKeyDown={[Function]}
7878
tabIndex={0}

src/__tests__/__snapshots__/AnchoredOverlay.tsx.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ exports[`AnchoredOverlay renders consistently 1`] = `
8181
>
8282
<button
8383
aria-haspopup="true"
84-
aria-labelledby="react-aria-5484257793-1"
84+
aria-labelledby="react-aria-0-1"
8585
className="c1"
86-
id="react-aria-5484257793-1"
86+
id="react-aria-0-1"
8787
onClick={[Function]}
8888
onKeyDown={[Function]}
8989
tabIndex={0}
@@ -197,9 +197,9 @@ Object {
197197
>
198198
<button
199199
aria-haspopup="true"
200-
aria-labelledby="react-aria-5484257793-8"
200+
aria-labelledby="react-aria-0-1"
201201
class="c1"
202-
id="react-aria-5484257793-8"
202+
id="react-aria-0-1"
203203
tabindex="0"
204204
>
205205
Anchor Button
@@ -242,9 +242,9 @@ Object {
242242
>
243243
<button
244244
aria-haspopup="true"
245-
aria-labelledby="react-aria-5484257793-8"
245+
aria-labelledby="react-aria-0-1"
246246
class="ButtonBase-sc-181ps9o-0 Button-xjtz72-0 jhgDtb"
247-
id="react-aria-5484257793-8"
247+
id="react-aria-0-1"
248248
tabindex="0"
249249
>
250250
Anchor Button

src/__tests__/__snapshots__/DropdownMenu.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ exports[`DropdownMenu renders consistently 1`] = `
7373
7474
<button
7575
aria-haspopup="true"
76-
aria-labelledby="react-aria-64373930-1"
76+
aria-labelledby="react-aria-4007736549-1"
7777
className="c0"
78-
id="react-aria-64373930-1"
78+
id="react-aria-4007736549-1"
7979
onClick={[Function]}
8080
onKeyDown={[Function]}
8181
tabIndex={0}

0 commit comments

Comments
 (0)