fix: popover ios issue (#25696)
* fix: popover ios issue * add comments * more comments
This commit is contained in:
1 parent
c361b9bbc5
commit
0604c960a4
3 files changed
+14
-23
No files matched your search
@@ -209,7 +209,7 @@ test.describe("Out of office", () => {
|
||||
await goToOOOPage(page);
|
||||
await openOOODialog(page);
|
||||
|
||||
await selectToAndFromDates(page, "13", "22", true);
|
||||
await selectToAndFromDates(page, "13", "22", "previous");
|
||||
|
||||
// send request
|
||||
await saveAndWaitForResponse(page);
|
||||
@@ -694,16 +694,21 @@ async function saveAndWaitForResponse(page: Page, expectedStatusCode = 200) {
|
||||
});
|
||||
}
|
||||
|
||||
async function selectToAndFromDates(page: Page, fromDate: string, toDate: string, isRangeInPast = false) {
|
||||
async function selectToAndFromDates(
|
||||
page: Page,
|
||||
fromDate: string,
|
||||
toDate: string,
|
||||
month: "previous" | "next" = "next"
|
||||
) {
|
||||
await page.getByTestId("date-range").click();
|
||||
await page.locator(".rdp").waitFor({ state: "visible" });
|
||||
|
||||
const month = isRangeInPast ? "previous" : "next";
|
||||
|
||||
await page.locator(`button[name="${month}-month"]`).click();
|
||||
|
||||
await page.locator(`button[name="day"]:text-is("${fromDate}")`).nth(0).click();
|
||||
await page.locator(`button[name="day"]:text-is("${toDate}")`).nth(0).click();
|
||||
|
||||
await page.keyboard.press("Escape");
|
||||
}
|
||||
|
||||
async function selectDateAndCreateOOO(
|
||||
@@ -718,17 +723,8 @@ async function selectDateAndCreateOOO(
|
||||
) {
|
||||
const t = await localize("en");
|
||||
|
||||
await page.getByTestId("date-range").click();
|
||||
await page.locator(".rdp").waitFor({ state: "visible" });
|
||||
await selectToAndFromDates(page, fromDate, toDate, month);
|
||||
|
||||
// Look for month navigation button
|
||||
const monthButtonSelector = `button[name="${month}-month"]`;
|
||||
|
||||
await page.locator(monthButtonSelector).click();
|
||||
|
||||
await page.locator(`button[name="day"]:text-is("${fromDate}")`).nth(0).click();
|
||||
|
||||
await page.locator(`button[name="day"]:text-is("${toDate}")`).nth(0).click();
|
||||
if (editMode) {
|
||||
await page.locator(`text=${t("edit_an_out_of_office")}`).click();
|
||||
} else if (forTeamMember) {
|
||||
@@ -757,12 +753,5 @@ async function goToOOOPage(page: Page, type: "individual" | "team" = "individual
|
||||
}
|
||||
|
||||
async function openOOODialog(page: Page) {
|
||||
const reasonListRespPromise = page.waitForResponse(
|
||||
(response) => response.url().includes("outOfOfficeReasonList?batch=1") && response.status() === 200
|
||||
);
|
||||
const hasTeamPlanRespPromise = page.waitForResponse(
|
||||
(response) => response.url().includes("hasTeamPlan?batch=1") && response.status() === 200
|
||||
);
|
||||
await page.getByTestId("add_entry_ooo").click();
|
||||
await Promise.all([reasonListRespPromise, hasTeamPlanRespPromise]);
|
||||
}
|
||||
Reference in new issue
Block a user