kaxil commented on code in PR #72909: URL: https://github.com/apache/airflow/pull/72909#discussion_r4020255155
########## airflow-core/src/airflow/ui/tests/e2e/specs/dag-bundles.spec.ts: ########## @@ -0,0 +1,71 @@ +/*! + * 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. + */ +import { expect, test } from "tests/e2e/fixtures"; + +test.describe("Dag Bundles Page", () => { + test.beforeEach(async ({ dagBundlesPage }) => { + await dagBundlesPage.navigate(); + }); + + test("verify dag bundles page heading", async ({ dagBundlesPage }) => { + await expect(dagBundlesPage.heading).toBeVisible(); + }); + + test("Verify Dag Bundles page is accessible via Browse menu", async ({ dagBundlesPage }) => { + await dagBundlesPage.navigateFromBrowseMenu(); + + await dagBundlesPage.waitForLoad(); + await expect(dagBundlesPage.heading).toBeVisible(); + expect(await dagBundlesPage.getRowCount()).toBeGreaterThan(0); + }); + + test("Verify the dag bundles list displays", async ({ dagBundlesPage }) => { + await expect(dagBundlesPage.table).toBeVisible(); + }); + + test("Verify the configured bundle is listed with a name and an active state", async ({ + dagBundlesPage, + }) => { + expect(await dagBundlesPage.getRowCount()).toBeGreaterThan(0); + + await expect(dagBundlesPage.nameCellAt(0)).not.toBeEmpty(); + // Spelled out both ways rather than left blank when healthy, so the cell is never empty. + await expect(dagBundlesPage.activeCellAt(0)).toHaveText(/^(active|inactive)$/i); + }); + + test("Verify the version cell says what it knows", async ({ dagBundlesPage }) => { Review Comment: Agreed, they were smoke checks. Added `src/pages/DagBundles/DagBundles.test.tsx` in 8e53572 with fake timers over the real page and `msw`, covering the four cases you asked for: the ten-second floor holding against the 3s default, a configured 30s being left alone rather than pulled down, 0 disabling refresh entirely, and an updated response changing the rendered version. I verified they fail for the right reason rather than trusting them. Replacing `refetchInterval` with `configuredInterval` (dropping the floor and the zero guard) fails the floor test; replacing it with `false` fails three of the four, which is the regression you described. Two things worth knowing about the harness. The page fetches once before `[api] auto_refresh_interval` lands and again once it does, so each test drains that startup traffic and then counts from the settled total instead of from zero. And StrictMode mounts the page twice, so a tick issues one request per observer; the assertions are therefore "refreshed" or "did not refresh" rather than an exact delta. The Browse navigation check stays in Playwright, as you suggested. -- 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]
