From cb4d027e18da9b63cdecfe0a730c8cc8466b3d6e Mon Sep 17 00:00:00 2001 From: Aleh Makaranka <29537473+cpof-tea@users.noreply.github.com> Date: Tue, 7 Nov 2023 20:51:28 +0400 Subject: [PATCH 1/4] Pass `rawProps` to `renderView` --- uui/components/layout/VirtualList.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/uui/components/layout/VirtualList.tsx b/uui/components/layout/VirtualList.tsx index 4a292f5d49..73749a2445 100644 --- a/uui/components/layout/VirtualList.tsx +++ b/uui/components/layout/VirtualList.tsx @@ -66,6 +66,14 @@ export const VirtualList = React.forwardRef((pr ); + const renderView = ({ style }: any) => ( + + ); + const scrollBarsRef = React.useCallback((scrollbars: ScrollbarsApi) => { if (!scrollbars?.container?.firstChild) return; scrollContainerRef.current = scrollbars.container.firstChild as HTMLDivElement; @@ -79,7 +87,7 @@ export const VirtualList = React.forwardRef((pr [uuiMarkers.scrolledBottom]: scrollShadows.verticalBottom, }) } onScroll={ handleScroll } - renderView={ ({ style }: any) => } + renderView={ renderView } ref={ scrollBarsRef } > {renderRows()} From 01e9eb3014ab1e2c85377f42262680c3e7878d28 Mon Sep 17 00:00:00 2001 From: Aleh Makaranka <29537473+cpof-tea@users.noreply.github.com> Date: Tue, 7 Nov 2023 20:52:53 +0400 Subject: [PATCH 2/4] Add test --- uui/components/tables/__tests__/DataTable.test.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/uui/components/tables/__tests__/DataTable.test.tsx b/uui/components/tables/__tests__/DataTable.test.tsx index 0b3066d176..ae32ba1f9c 100644 --- a/uui/components/tables/__tests__/DataTable.test.tsx +++ b/uui/components/tables/__tests__/DataTable.test.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { renderSnapshotWithContextAsync } from '@epam/uui-test-utils'; +import { renderSnapshotWithContextAsync, renderWithContextAsync, screen } from '@epam/uui-test-utils'; import { DataTable } from '../DataTable'; class ResizeObserverMock { @@ -15,4 +15,9 @@ describe('DataTable', () => { const tree = await renderSnapshotWithContextAsync( [] } value={ {} } onValueChange={ jest.fn } />); expect(tree).toMatchSnapshot(); }); + + it('should have role=table', async () => { + await renderWithContextAsync( [] } value={ {} } onValueChange={ jest.fn } />); + expect(screen.getByRole('table')).toBeInTheDocument(); + }); }); From bc682b8b0707b05203b838a1e76b09ae58cd44d9 Mon Sep 17 00:00:00 2001 From: Aleh Makaranka <29537473+cpof-tea@users.noreply.github.com> Date: Tue, 7 Nov 2023 20:58:31 +0400 Subject: [PATCH 3/4] Update snapshots --- .../pickers/__tests__/__snapshots__/PickerInput.test.tsx.snap | 1 + .../tables/__tests__/__snapshots__/DataTable.test.tsx.snap | 2 ++ 2 files changed, 3 insertions(+) diff --git a/uui/components/pickers/__tests__/__snapshots__/PickerInput.test.tsx.snap b/uui/components/pickers/__tests__/__snapshots__/PickerInput.test.tsx.snap index 7fbb52db73..cfe01ee66b 100644 --- a/uui/components/pickers/__tests__/__snapshots__/PickerInput.test.tsx.snap +++ b/uui/components/pickers/__tests__/__snapshots__/PickerInput.test.tsx.snap @@ -57,6 +57,7 @@ exports[`PickerInput should open body 1`] = ` style="position: relative; overflow: hidden; width: 100%; height: 100%; display: flex;" >
Date: Tue, 7 Nov 2023 21:01:26 +0400 Subject: [PATCH 4/4] Update changelog --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 37e228d229..1be1381cd5 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,7 @@ [PickerInput]: set `overflow: hidden;` on open for mobile [TextArea and TextInput]: fix maxLength for Android [PickerInput]: Disable select all button if options are empty and it has no selection +[DataTable]: fixed missing `role=table` # 5.2.0 - 16.10.2023