bito-code-review[bot] commented on code in PR #39231:
URL: https://github.com/apache/superset/pull/39231#discussion_r3232636798


##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/Header.test.tsx:
##########
@@ -53,3 +53,21 @@ test('should toggle', () => {
   userEvent.click(expandBtn);
   expect(mockedProps.toggleFiltersBar).toHaveBeenCalled();
 });
+
+test('collapse button should have aria-expanded attribute', () => {
+  const mockedProps = createProps();
+  render(<Header {...mockedProps} />, { useRedux: true });
+  const collapseBtn = screen.getByRole('button', {
+    name: 'vertical-align',
+  });
+  expect(collapseBtn).toHaveAttribute('aria-expanded', 'true');
+});
+
+test('collapse button should have aria-label for accessibility', () => {
+  const mockedProps = createProps();
+  render(<Header {...mockedProps} />, { useRedux: true });
+  const collapseBtn = screen.getByRole('button', {
+    name: 'vertical-align',
+  });
+  expect(collapseBtn).toHaveAttribute('aria-label', 'Collapse filters');
+});

Review Comment:
   <!-- Bito Reply -->
   The `/resolve` command is not supported on inline comments. Please use it in 
a top-level comment instead.



##########
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'));
+  // TODO: fix this flaky test
+  // await screen.findByText('All filters (1)');

Review Comment:
   <!-- Bito Reply -->
   The `/resolve` command is not supported on inline comments. Please use it in 
a top-level comment instead.



##########
superset-frontend/src/dashboard/components/AutoRefreshIndicator/index.tsx:
##########
@@ -124,6 +124,7 @@ export const AutoRefreshIndicator: 
FC<AutoRefreshIndicatorProps> = ({
           css={iconButtonStyles}
           onClick={onTogglePause}
           aria-label={tooltipTitle}
+          aria-pressed={isPaused}

Review Comment:
   <!-- Bito Reply -->
   The `/resolve` command is not supported on inline comments. Please use it in 
a top-level comment instead.



-- 
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]

Reply via email to