-
Notifications
You must be signed in to change notification settings - Fork 186
Open
Description
I got error: Unable to find an accessible element with the role "listitem".
I cannot get list of content to test action on that.
import {render, screen} from '@testing-library/react'
import {FileArray, FileBrowser} from 'chonky'
import {describe, expect, it} from 'vitest'
const DATA: {data: FileArray} = {
data: [
{
name: '2024-02-05.jpg',
id: '2024-02-05.jpg',
thumbnailUrl: 'TEST',
size: 122161,
modDate: '2024-06-12T02:03:31.000Z'
}
]
}
describe('FileBrowser', () => {
it('should display file list', () => {
render(<FileBrowser files={DATA.data} />)
const fileItems = screen.getAllByRole('listitem')
expect(fileItems).toHaveLength(2)
expect(fileItems[0]).toHaveTextContent('2024-02-05.jpg')
})
})
Metadata
Metadata
Assignees
Labels
No labels