fix: change order of eventtypes and routingforms (#17615)
* change order of eventtypes and routingforms * for workflows * for filtered workflows * update slug of first expected event-type * updated due to latest merges * test to ensure new eventtype added is first in the list * test for workflows --------- Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
This commit is contained in:
6 files changed
+39
-14
No files matched your search
@@ -64,7 +64,7 @@ test.describe("Embed Code Generator Tests", () => {
|
||||
await page.waitForTimeout(1000);
|
||||
await expectToContainValidPreviewIframe(page, {
|
||||
embedType: "inline",
|
||||
calLink: `${pro.username}/30-min`,
|
||||
calLink: `${pro.username}/multiple-duration`,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -102,7 +102,7 @@ test.describe("Embed Code Generator Tests", () => {
|
||||
await page.waitForTimeout(1000);
|
||||
await expectToContainValidPreviewIframe(page, {
|
||||
embedType: "floating-popup",
|
||||
calLink: `${pro.username}/30-min`,
|
||||
calLink: `${pro.username}/multiple-duration`,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -140,7 +140,7 @@ test.describe("Embed Code Generator Tests", () => {
|
||||
await page.waitForTimeout(1000);
|
||||
await expectToContainValidPreviewIframe(page, {
|
||||
embedType: "element-click",
|
||||
calLink: `${pro.username}/30-min`,
|
||||
calLink: `${pro.username}/multiple-duration`,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -238,7 +238,7 @@ test.describe("Embed Code Generator Tests", () => {
|
||||
await page.waitForTimeout(1000);
|
||||
await expectToContainValidPreviewIframe(page, {
|
||||
embedType: "inline",
|
||||
calLink: `${user.username}/30-min`,
|
||||
calLink: `${user.username}/multiple-duration`,
|
||||
bookerUrl: getOrgFullOrigin(org?.slug ?? ""),
|
||||
});
|
||||
});
|
||||
@@ -279,7 +279,7 @@ test.describe("Embed Code Generator Tests", () => {
|
||||
await page.waitForTimeout(1000);
|
||||
await expectToContainValidPreviewIframe(page, {
|
||||
embedType: "floating-popup",
|
||||
calLink: `${user.username}/30-min`,
|
||||
calLink: `${user.username}/multiple-duration`,
|
||||
bookerUrl: getOrgFullOrigin(org?.slug ?? ""),
|
||||
});
|
||||
});
|
||||
@@ -319,7 +319,7 @@ test.describe("Embed Code Generator Tests", () => {
|
||||
await page.waitForTimeout(1000);
|
||||
await expectToContainValidPreviewIframe(page, {
|
||||
embedType: "element-click",
|
||||
calLink: `${user.username}/30-min`,
|
||||
calLink: `${user.username}/multiple-duration`,
|
||||
bookerUrl: getOrgFullOrigin(org?.slug ?? ""),
|
||||
});
|
||||
});
|
||||
|
||||
@@ -61,6 +61,16 @@ testBothFutureAndLegacyRoutes.describe("Event Types tests", () => {
|
||||
await expect(page.locator(`text='${eventTitle}'`)).toBeVisible();
|
||||
});
|
||||
|
||||
test("new event type appears first in the list", async ({ page }) => {
|
||||
const nonce = randomString(3);
|
||||
const eventTitle = `hello ${nonce}`;
|
||||
await createNewEventType(page, { eventTitle });
|
||||
await page.goto("/event-types");
|
||||
const firstEvent = page.locator("[data-testid=event-types] > li a").first();
|
||||
const firstEventTitle = await firstEvent.getAttribute("title");
|
||||
await expect(firstEventTitle).toBe(eventTitle);
|
||||
});
|
||||
|
||||
test("enabling recurring event comes with default options", async ({ page }) => {
|
||||
const nonce = randomString(3);
|
||||
const eventTitle = `my recurring event ${nonce}`;
|
||||
|
||||
@@ -99,6 +99,21 @@ test.describe("Routing Forms", () => {
|
||||
await expect(page.getByTestId(`404-page`)).toBeVisible();
|
||||
});
|
||||
|
||||
test("recently added form appears first in the list", async ({ page }) => {
|
||||
await addForm(page, { name: "Test Form 1" });
|
||||
await page.goto(`apps/routing-forms/forms`);
|
||||
await page.waitForSelector('[data-testid="routing-forms-list"]');
|
||||
await expect(page.locator('[data-testid="routing-forms-list"] > div h1')).toHaveCount(1);
|
||||
|
||||
await addForm(page, { name: "Test Form 2" });
|
||||
await page.goto(`apps/routing-forms/forms`);
|
||||
await page.waitForSelector('[data-testid="routing-forms-list"]');
|
||||
await expect(page.locator('[data-testid="routing-forms-list"] > div h1')).toHaveCount(2);
|
||||
|
||||
const firstForm = page.locator('[data-testid="routing-forms-list"] > div h1').first();
|
||||
await expect(firstForm).toHaveText("Test Form 2");
|
||||
});
|
||||
|
||||
test("should be able to edit a newly created form", async ({ page }) => {
|
||||
const formId = await addForm(page);
|
||||
const description = "Test Description";
|
||||
|
||||
@@ -31,7 +31,7 @@ export const formsHandler = async ({ ctx, input }: FormsHandlerOptions) => {
|
||||
position: "desc",
|
||||
},
|
||||
{
|
||||
createdAt: "asc",
|
||||
createdAt: "desc",
|
||||
},
|
||||
],
|
||||
include: {
|
||||
|
||||
@@ -213,7 +213,7 @@ export class WorkflowRepository {
|
||||
position: "desc",
|
||||
},
|
||||
{
|
||||
id: "asc",
|
||||
id: "desc",
|
||||
},
|
||||
],
|
||||
});
|
||||
@@ -267,7 +267,7 @@ export class WorkflowRepository {
|
||||
where,
|
||||
include: includedFields,
|
||||
orderBy: {
|
||||
id: "asc",
|
||||
id: "desc",
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ export const getEventTypesFromGroup = async ({
|
||||
position: "desc",
|
||||
},
|
||||
{
|
||||
id: "asc",
|
||||
id: "desc",
|
||||
},
|
||||
],
|
||||
limit,
|
||||
@@ -94,7 +94,7 @@ export const getEventTypesFromGroup = async ({
|
||||
position: "desc",
|
||||
},
|
||||
{
|
||||
id: "asc",
|
||||
id: "desc",
|
||||
},
|
||||
],
|
||||
limit,
|
||||
@@ -108,8 +108,8 @@ export const getEventTypesFromGroup = async ({
|
||||
if (a.position !== b.position) {
|
||||
return b.position - a.position;
|
||||
}
|
||||
// Then by id in ascending order
|
||||
return a.id - b.id;
|
||||
// Then by id in descending order
|
||||
return b.id - a.id;
|
||||
});
|
||||
|
||||
eventTypes.push(...userEventTypes);
|
||||
@@ -136,7 +136,7 @@ export const getEventTypesFromGroup = async ({
|
||||
position: "desc",
|
||||
},
|
||||
{
|
||||
id: "asc",
|
||||
id: "desc",
|
||||
},
|
||||
],
|
||||
})) ?? [];
|
||||
|
||||
Reference in new issue
Block a user