codeant-ai-for-open-source[bot] commented on code in PR #41999: URL: https://github.com/apache/superset/pull/41999#discussion_r3570804579
########## superset-frontend/playwright/tests/dashboard/delete-display-control.spec.ts: ########## @@ -0,0 +1,262 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Regression test: a deleted Display Control (chart customization) must not + * reappear after clicking "Apply Filters". Seeds a dashboard with a Gender + * filter and a Time grain Display Control, deletes the control via the config + * modal, then applies and asserts it stays gone. + */ +import { testWithAssets, expect } from '../../helpers/fixtures'; +import { apiPost, apiPut } from '../../helpers/api/requests'; +import { apiPostDashboard } from '../../helpers/api/dashboard'; +import { DashboardPage } from '../../pages/DashboardPage'; + +// Record video regardless of pass/fail (before/after clips). +testWithAssets.use({ video: 'on' }); + +const DATASET_NAME = 'birth_names'; +const FILTER_COLUMN = 'gender'; +const TEMPORAL_COLUMN = 'ds'; + +async function findDatasetIdByName(page: any, name: string): Promise<number> { + const rison = `(filters:!((col:table_name,opr:eq,value:'${name}')))`; + const resp = await page.request.get(`api/v1/dataset/?q=${rison}`); + const body = await resp.json(); + if (!body.result?.length) { + throw new Error(`Dataset ${name} not found`); + } + return body.result[0].id; +} + +testWithAssets( + 'Deleted Display Control must not reappear after Apply Filters (before)', Review Comment: **Suggestion:** The test title contradicts the asserted behavior: it says “(before)” while the test verifies the fixed post-change behavior (“must not reappear”). This makes failures and reports misleading during triage; rename the title to reflect the after/fixed expectation. [comment mismatch] <details> <summary><b>Severity Level:</b> Minor 🧹</summary> ```mdx - ⚠️ Test title implies pre-fix behavior, assertion post-fix. - ⚠️ Misleading failure reports during dashboard display control triage. ``` </details> <details> <summary><b>Steps of Reproduction ✅ </b></summary> ```mdx 1. Open `superset-frontend/playwright/tests/dashboard/delete-display-control.spec.ts` and observe the Playwright test definition at lines 48-50 using `testWithAssets('Deleted Display Control must not reappear after Apply Filters (before)', ...)`. 2. Note that the doc comment at lines 20-24 and the final assertion at lines 256-259 both describe and enforce the fixed behavior: the deleted Display Control must stay gone after Apply Filters. 3. Run the test via `npm run playwright:test -- tests/dashboard/delete-display-control.spec.ts`; Playwright reports the test title including the `(before)` suffix even though it is validating the post-fix behavior. 4. When this regression test fails (e.g., due to future changes), the failure output and videos are labeled as "(before)", contradicting the verified behavior and making triage/debugging confusing because the name implies pre-fix behavior. ``` </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=6fea6f53b7294a86af04edd38c00cd96&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=6fea6f53b7294a86af04edd38c00cd96&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) *(Use Cmd/Ctrl + Click for best experience)* <details> <summary><b>Prompt for AI Agent 🤖 </b></summary> ```mdx This is a comment left during a code review. **Path:** superset-frontend/playwright/tests/dashboard/delete-display-control.spec.ts **Line:** 49:49 **Comment:** *Comment Mismatch: The test title contradicts the asserted behavior: it says “(before)” while the test verifies the fixed post-change behavior (“must not reappear”). This makes failures and reports misleading during triage; rename the title to reflect the after/fixed expectation. Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix ``` </details> <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41999&comment_hash=8a8f6d3ed31e516ef6fe6b851ba89e76638b15cfac1d44287128199e72803c4c&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41999&comment_hash=8a8f6d3ed31e516ef6fe6b851ba89e76638b15cfac1d44287128199e72803c4c&reaction=dislike'>👎</a> -- 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]
