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


##########
superset-frontend/playwright/tests/chart/chart-list.spec.ts:
##########
@@ -214,7 +231,7 @@ test('should bulk delete multiple charts', async ({
   await chartListPage.selectChartCheckbox(chart2.name);
 
   // Click bulk delete action
-  await chartListPage.clickBulkAction('Delete');
+  await chartListPage.clickBulkAction('delete');

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Extract bulk delete confirmation helper</b></div>
   <div id="fix">
   
   Found syntactic duplication (70 tokens) spanning 3 test files: 
chart-list.spec.ts (234-254), dashboard-list.spec.ts (188-208), and 
dataset-list.spec.ts (428-448). The bulk delete confirmation modal pattern is 
repeated verbatim. Consider extracting into a shared helper function to improve 
maintainability and reduce code duplication.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ```
    @@ -1,10 +1,15 @@
     // Shared test utilities
    +import { Page } from '@playwright/test';
    +import { DeleteConfirmationModal } from './DeleteConfirmationModal';
    +import { Toast } from './Toast';
    +
    +export async function confirmBulkDelete(
    +  page: Page,
    +  listPage: any,
    +  items: { name: string }[]
    +): Promise<void> {
    +  // Delete confirmation modal should appear
    +  const deleteModal = new DeleteConfirmationModal(page);
    +  await deleteModal.waitForVisible();
    +
    +  // Type "DELETE" to confirm
    +  await deleteModal.fillConfirmationInput('DELETE');
    +
    +  // Click the Delete button
    +  await deleteModal.clickDelete();
    +
    +  // Modal should close
    +  await deleteModal.waitForHidden();
    +
    +  // Verify success toast appears.
    +  const toast = new Toast(page);
    +  await expect(toast.getSuccess()).toBeVisible();
    +
    +  // Verify items are removed from list
    +  for (const item of items) {
    +    await expect(listPage.getRow(item.name)).toHaveCount(0);
    +  }
    +}
   ```
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #7f9740</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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