Skip to content

Commit

Permalink
test(menu): fix test not passing after change to portal
Browse files Browse the repository at this point in the history
  • Loading branch information
anitavincent committed Nov 29, 2023
1 parent a15e8b9 commit eb9a97b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions packages/components/src/menu/stories/menu.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import '../../../dist/styles.min.css'
import '../menu.css'
import './style.css'
import React from 'react'
import {
Expand Down
6 changes: 4 additions & 2 deletions packages/components/src/menu/tests/menu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { MenuSeparator } from '../menu-separator'

describe('menu', () => {
it('renders', () => {
const { container } = render(
const { container, unmount } = render(
<MenuProvider>
<MenuTrigger asChild>
<button>Open</button>
Expand All @@ -20,7 +20,7 @@ describe('menu', () => {
<MenuSeparator />
<MenuItem>Item 3</MenuItem>
</Menu>
</MenuProvider>
</MenuProvider>, {container: document.body}
)

expect(container.querySelector('[data-sl-menu]')).toBeInTheDocument()
Expand All @@ -31,5 +31,7 @@ describe('menu', () => {
expect(
container.querySelector('[data-sl-menu-separator]')
).toBeInTheDocument()

unmount()
})
})

0 comments on commit eb9a97b

Please sign in to comment.