Skip to content

Commit 8b07bed

Browse files
committed
Fix UI test failures after Time Schedule filter changes
- Provide timezone context required by the new time filters - Format the Dag run limit counter according to locale conventions - Align the limit option test with formatted number output
1 parent bd031a1 commit 8b07bed

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎airflow-core/src/airflow/ui/public/i18n/locales/en/common.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@
518518
"dagRunLimit": "Dag run limit",
519519
"dagRunLimitHelp": "Displays the most recent Dag runs that match the current filters, up to the selected limit.",
520520
"dagRunLimitHelpLabel": "About Dag run limit",
521-
"dagRunLimitOption": "Limit {{count}}",
521+
"dagRunLimitOption": "Limit {{count, number}}",
522522
"dagRunsToDisplay": "Dag runs to display",
523523
"day": "Day",
524524
"description": "Explore Dag run timing and overlaps.",

‎airflow-core/src/airflow/ui/src/pages/TimeSchedule/TimeSchedule.test.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
import "@testing-library/jest-dom";
19+
import "@testing-library/jest-dom/vitest";
2020
import { fireEvent, render as baseRender, screen, waitFor, within } from "@testing-library/react";
2121
import i18n from "i18next";
2222
import { initReactI18next } from "react-i18next";
@@ -322,7 +322,7 @@ describe("TimeSchedule page", () => {
322322
fireEvent.click(within(screen.getByTestId("time-schedule-dag-run-limit")).getByRole("combobox"));
323323

324324
expect(await screen.findByRole("option", { name: "Limit 200" })).toBeInTheDocument();
325-
expect(screen.getByRole("option", { name: "Limit 5000" })).toBeInTheDocument();
325+
expect(screen.getByRole("option", { name: "Limit 5,000" })).toBeInTheDocument();
326326
expect(screen.queryByRole("option", { name: /All Dag runs/u })).not.toBeInTheDocument();
327327

328328
fireEvent.click(screen.getByRole("option", { name: "Limit 600" }));

‎airflow-core/src/airflow/ui/src/utils/useFiltersHandler.test.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { afterEach, describe, expect, it } from "vitest";
2525
import { isValidFilterValue } from "src/components/FilterBar/utils";
2626

2727
import { SearchParamsKeys } from "src/constants/searchParams";
28+
import { TimezoneProvider } from "src/context/timezone";
2829
import { BaseWrapper } from "src/utils/Wrapper";
2930

3031
import { useFiltersHandler } from "./useFiltersHandler";
@@ -33,7 +34,9 @@ const createWrapper =
3334
(initialEntries: Array<string> = ["/dags"]) =>
3435
({ children }: PropsWithChildren) => (
3536
<BaseWrapper>
36-
<MemoryRouter initialEntries={initialEntries}>{children}</MemoryRouter>
37+
<MemoryRouter initialEntries={initialEntries}>
38+
<TimezoneProvider>{children}</TimezoneProvider>
39+
</MemoryRouter>
3740
</BaseWrapper>
3841
);
3942

0 commit comments

Comments
 (0)