You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2026/06/11 19:52:30 UTC
(superset) 01/01: fix: Flaky dataset permissions test
This is an automated email from the ASF dual-hosted git repository.
michael-s-molina pushed a commit to branch 6.1
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 5919bf785a134dcd97cd44a6f943b397db07174c
Author: Michael S. Molina <mi...@gmail.com>
AuthorDate: Thu Jun 11 16:07:46 2026 -0300
fix: Flaky dataset permissions test
---
.../DatasetList/DatasetList.permissions.test.tsx | 30 +++++++---------------
1 file changed, 9 insertions(+), 21 deletions(-)
diff --git a/superset-frontend/src/pages/DatasetList/DatasetList.permissions.test.tsx b/superset-frontend/src/pages/DatasetList/DatasetList.permissions.test.tsx
index d69594fbdc0..b73bb45f4d5 100644
--- a/superset-frontend/src/pages/DatasetList/DatasetList.permissions.test.tsx
+++ b/superset-frontend/src/pages/DatasetList/DatasetList.permissions.test.tsx
@@ -63,31 +63,19 @@ test('admin users see all UI elements', async () => {
renderDatasetList(mockAdminUser);
- expect(await screen.findByText('Datasets')).toBeInTheDocument();
-
- // Admin should see create button
- expect(
- screen.getByRole('button', { name: /(?:plus\s*)?Dataset$/i }),
- ).toBeInTheDocument();
-
- // Admin should see import button
- // Note: Using testId - import button lacks accessible text content
- // TODO: Add aria-label or text to import button
- expect(screen.getByTestId('import-button')).toBeInTheDocument();
-
- // Admin should see bulk select button
- expect(
- screen.getByRole('button', { name: /bulk select/i }),
- ).toBeInTheDocument();
-
- // Admin should see actions column - wait for table first, then check column
- const table = await screen.findByTestId('listview-table');
+ // All permission-gated elements share the same canWrite flag from _info,
+ // so waiting for all of them in a single waitFor avoids redundant retries.
await waitFor(() => {
+ expect(screen.getByText('Datasets')).toBeInTheDocument();
expect(
- within(table).getByRole('columnheader', { name: /Actions/i }),
+ screen.getByRole('button', { name: /(?:plus\s*)?Dataset$/i }),
+ ).toBeInTheDocument();
+ expect(screen.getByTestId('import-button')).toBeInTheDocument();
+ expect(
+ screen.getByRole('button', { name: /bulk select/i }),
).toBeInTheDocument();
});
-}, 45000);
+});
test('read-only users cannot see Actions column', async () => {
// Setup API with read-only permissions