Allow changed schedule searches after submit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { test, expect } from "./fixtures/console-gate";
|
||||
|
||||
test.describe("Schedule results filter", () => {
|
||||
test("changed route criteria can be submitted immediately after a previous search", async ({
|
||||
page,
|
||||
consoleMessages,
|
||||
}) => {
|
||||
await page.goto("/ru-ru/schedule/route/VVO-MJZ-20260518-20260524");
|
||||
|
||||
await expect(page.locator("h1")).toContainText(/Владивосток.*Мирный|VVO.*MJZ/, {
|
||||
timeout: 30000,
|
||||
});
|
||||
await expect(page.getByTestId("loader-bar")).toBeHidden({ timeout: 30000 });
|
||||
|
||||
const submit = page.getByTestId("search-submit");
|
||||
await expect(submit).toBeEnabled();
|
||||
await submit.click();
|
||||
await expect(submit).toBeDisabled();
|
||||
|
||||
await page.getByTestId("swap-cities-button").click();
|
||||
|
||||
await expect(submit).toBeEnabled();
|
||||
|
||||
const scheduleResponse = page.waitForResponse(
|
||||
(response) =>
|
||||
response.url().includes("/api/flights/1/ru/schedule") &&
|
||||
response.url().includes("departure=MJZ") &&
|
||||
response.url().includes("arrival=VVO"),
|
||||
);
|
||||
await submit.click();
|
||||
|
||||
await expect(page).toHaveURL(/\/ru-ru\/schedule\/route\/MJZ-VVO-20260518-20260524/);
|
||||
expect((await scheduleResponse).status()).toBe(200);
|
||||
expect(consoleMessages).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user