Pushkal-Gupta opened a new pull request, #75963:
URL: https://github.com/apache/airflow/pull/75963

   `main` is red for the UI right now. `pnpm run lint` exits 1, and 
`DagsFilters.test.tsx` throws before it asserts anything:
   
   ```
   ReferenceError: within is not defined
    ❯ src/pages/DagsList/DagsFilters/DagsFilters.test.tsx:250:15
   ```
   
   The line is:
   
   ```ts
   
fireEvent.click(within(screen.getByTestId("paused-pill")).getByRole("button"));
   ```
   
   `within` is not imported in this file.
   
   ### How it happened
   
   Two PRs that were each green on their own. #75350 wrote this line and last 
ran CI on 23 Oct, back when `FilterPill` had its remove button nested inside 
the `-pill` element, so the query found it. #75418 then reshaped the pill on 
`main`: the remove button became a sibling with its own `-pill-remove` testid, 
the `within` import went away, and the other two call sites in this same file 
moved to the new testid.
   
   #75350 merged six days later without running again. Merging the file took 
`main`'s import line, which has no `within`, and kept #75350's line 250, which 
still calls it.
   
   That leaves the line wrong twice over. Even with the import back the query 
cannot match, because the pill body now holds only an icon and a text node:
   
   ```
   Unable to find an accessible element with the role "button"
   <button class="css-1am9w2y" data-testid="paused-pill">
     <svg .../>
   ```
   
   ### The fix
   
   Lines 119 and 164 of this same file are the two call sites #75418 already 
migrated, so line 250 gets the same treatment. `within` then has no uses left 
and the import stays as `main` has it. `AssetsList.test.tsx` uses the same 
`-pill-remove` form in three places.
   
   The test still checks what it was written to check: removing the paused 
filter brings back `paused_dag` and `draining_dag`.
   
   ### Why CI missed it
   
   The UI jobs are selected only when UI files change, and nothing since the 
merge has touched one. `main`'s latest green run has 43 jobs and not one of 
them is a UI job, because that commit only touched 
`airflow-core/src/airflow/timetables/`. It stays hidden until someone opens a 
UI PR, and then it lands on them instead of on the change that caused it.
   
   ### Checks
   
   - `pnpm run lint` exits 1 on `main` and 0 with this change
   - `pnpm vitest run`: 2203 pass across 260 files, including all 17 here
   
   No newsfragment: test-only, nothing shipped changes.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes - Claude Code (Opus 5)
   
   Generated-by: Claude Code (Opus 5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


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

Reply via email to