Aitema-gmbh commented on code in PR #39231:
URL: https://github.com/apache/superset/pull/39231#discussion_r3232632034
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx:
##########
@@ -267,6 +267,9 @@ const VerticalFilterBar: FC<VerticalBarProps> = ({
className={cx({ open: !filtersOpen })}
onClick={openFiltersBar}
role="button"
Review Comment:
Addressed in aabe2d99 — added onKeyDown handler that mirrors onClick for
Enter/Space so keyboard users can expand the collapsed filter bar. Resolving —
thanks for the catch.
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBar.test.tsx:
##########
@@ -56,49 +55,73 @@ class MainPreset extends Preset {
}
}
-new MainPreset().register();
-
fetchMock.get('glob:*/api/v1/dataset/7', {
description_columns: {},
id: 1,
- label_columns: { columns: 'Columns', table_name: 'Table Name' },
+ label_columns: {
+ columns: 'Columns',
+ table_name: 'Table Name',
+ },
result: {
metrics: [],
- columns: [{ column_name: 'Column A', id: 1 }],
+ columns: [
+ {
+ column_name: 'Column A',
+ id: 1,
+ },
+ ],
table_name: 'birth_names',
id: 1,
},
show_columns: ['id', 'table_name'],
});
-// Cleanup between tests
-beforeEach(() => {
- jest.clearAllMocks();
-});
-
const getTestId = testWithId<string>(FILTER_BAR_TEST_ID, true);
const getModalTestId = testWithId<string>(FILTERS_CONFIG_MODAL_TEST_ID, true);
-function createClosedBarProps(toggleFiltersBar = jest.fn()) {
- return { filtersOpen: false, toggleFiltersBar };
-}
+const FILTER_NAME = 'Time filter 1';
-function createOpenedBarProps(toggleFiltersBar = jest.fn()) {
- return { filtersOpen: true, toggleFiltersBar };
-}
+const addFilterFlow = async () => {
+ // open filter config modals
+ userEvent.click(screen.getByTestId(getTestId('collapsable')));
+ userEvent.click(screen.getByLabelText('setting'));
+ userEvent.click(screen.getByText('Add or edit filters and controls'));
+ // select filter
+ userEvent.click(screen.getByText('Value'));
+ userEvent.click(screen.getByText('Time range'));
+ userEvent.type(screen.getByTestId(getModalTestId('name-input')),
FILTER_NAME);
+ userEvent.click(screen.getByText('Save'));
Review Comment:
Addressed in e71b0d57 / f71a5361 — addFilterFlow now uses async
findByText/findByTestId and awaits every userEvent.click, with a final
assertion on 'All filters (1)'. Resolving — thanks for the catch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]