Skip to content

Commit

Permalink
feat(test): add tests for <List>
Browse files Browse the repository at this point in the history
  • Loading branch information
robertu7 committed Oct 17, 2023
1 parent 20d0c47 commit 6a4e42b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/components/List/List.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react'
import { describe, expect, it } from 'vitest'

import { render, screen } from '~/common/utils/test'
import { List } from '~/components'

describe('<List>', () => {
it('should render list with items', () => {
render(
<List>
<List.Item>Item 1</List.Item>
<List.Item>Item 2</List.Item>
</List>
)

expect(screen.getByRole('list')).toBeInTheDocument()
expect(screen.getAllByRole('listitem')).toHaveLength(2)
})
})
2 changes: 1 addition & 1 deletion src/components/Menu/Menu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { fireEvent, render, screen } from '~/common/utils/test'
import { Menu } from '~/components'

describe('<Menu>', () => {
it('should render Menu with items', () => {
it('should render menu with items', () => {
const handleMenuAClick = vi.fn()
const handleMenuBClick = vi.fn()

Expand Down

0 comments on commit 6a4e42b

Please sign in to comment.