fix: circular dependencies (#20378)
* fix: circular dependencies * fix: type err
This commit is contained in:
1 parent
d04f10e7d1
commit
596e9b4e5a
20 files changed
+158
-146
No files matched your search
@@ -1,11 +1,5 @@
|
||||
import { test } from "../../lib/fixtures";
|
||||
|
||||
export type TApp = {
|
||||
slug: string;
|
||||
type: string;
|
||||
organizerInputPlaceholder?: string;
|
||||
label: string;
|
||||
};
|
||||
import type { TApp } from "./types";
|
||||
|
||||
const APP: TApp = {
|
||||
slug: "around",
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
export type TApp = {
|
||||
slug: string;
|
||||
type: string;
|
||||
organizerInputPlaceholder?: string;
|
||||
label: string;
|
||||
};
|
||||
@@ -3,7 +3,8 @@ import { expect } from "@playwright/test";
|
||||
import dayjs from "@calcom/dayjs";
|
||||
|
||||
import { test } from "./lib/fixtures";
|
||||
import { localize, submitAndWaitForResponse } from "./lib/testUtils";
|
||||
import { localize } from "./lib/localize";
|
||||
import { submitAndWaitForResponse } from "./lib/testUtils";
|
||||
|
||||
test.describe.configure({ mode: "parallel" });
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { expect, type Page } from "@playwright/test";
|
||||
|
||||
import type { TApp } from "../apps/conferencing/conferencingApps.e2e";
|
||||
import type { TApp } from "../apps/conferencing/types";
|
||||
import {
|
||||
bookTimeSlot,
|
||||
gotoBookingPage,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { expect, type Page } from "@playwright/test";
|
||||
|
||||
import { localize } from "../lib/testUtils";
|
||||
import { localize } from "../lib/localize";
|
||||
|
||||
export function createEventTypeFixture(page: Page) {
|
||||
return {
|
||||
|
||||
@@ -2,7 +2,8 @@ import { expect, type Page } from "@playwright/test";
|
||||
|
||||
import type { MembershipRole } from "@calcom/prisma/enums";
|
||||
|
||||
import { localize, submitAndWaitForResponse } from "../lib/testUtils";
|
||||
import { localize } from "../lib/localize";
|
||||
import { submitAndWaitForResponse } from "../lib/testUtils";
|
||||
import type { createUsersFixture } from "./users";
|
||||
|
||||
export const scheduleSuccessfullyText = "This meeting is scheduled";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { expect, type Page } from "@playwright/test";
|
||||
import prisma from "@calcom/prisma";
|
||||
import { WorkflowTriggerEvents } from "@calcom/prisma/enums";
|
||||
|
||||
import { localize } from "../lib/testUtils";
|
||||
import { localize } from "../lib/localize";
|
||||
|
||||
type CreateWorkflowProps = {
|
||||
name?: string;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import { loadJSON } from "./loadJSON";
|
||||
|
||||
// Provide an standalone localize utility not managed by next-i18n
|
||||
export async function localize(locale: string) {
|
||||
const localeModule = `../../public/static/locales/${locale}/common.json`;
|
||||
const localeMap = loadJSON(localeModule);
|
||||
return (message: string) => {
|
||||
if (message in localeMap) return localeMap[message];
|
||||
throw "No locale found for the given entry message";
|
||||
};
|
||||
}
|
||||
@@ -14,7 +14,6 @@ import { BookingStatus, SchedulingType } from "@calcom/prisma/enums";
|
||||
|
||||
import type { createEmailsFixture } from "../fixtures/emails";
|
||||
import type { Fixtures } from "./fixtures";
|
||||
import { loadJSON } from "./loadJSON";
|
||||
|
||||
type Request = IncomingMessage & { body?: unknown };
|
||||
type RequestHandlerOptions = { req: Request; res: ServerResponse };
|
||||
@@ -178,16 +177,6 @@ export async function expectSlotNotAllowedToBook(page: Page) {
|
||||
await expect(page.locator("[data-testid=slot-not-allowed-to-book]")).toBeVisible();
|
||||
}
|
||||
|
||||
// Provide an standalone localize utility not managed by next-i18n
|
||||
export async function localize(locale: string) {
|
||||
const localeModule = `../../public/static/locales/${locale}/common.json`;
|
||||
const localeMap = loadJSON(localeModule);
|
||||
return (message: string) => {
|
||||
if (message in localeMap) return localeMap[message];
|
||||
throw "No locale found for the given entry message";
|
||||
};
|
||||
}
|
||||
|
||||
export const createNewEventType = async (page: Page, args: { eventTitle: string }) => {
|
||||
await page.click("[data-testid=new-event-type]");
|
||||
const eventTitle = args.eventTitle;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { expect } from "@playwright/test";
|
||||
|
||||
import { login } from "./fixtures/users";
|
||||
import { test } from "./lib/fixtures";
|
||||
import { localize } from "./lib/testUtils";
|
||||
import { localize } from "./lib/localize";
|
||||
|
||||
test.describe.configure({ mode: "parallel" });
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ import type { Locator, Page } from "@playwright/test";
|
||||
import { expect } from "@playwright/test";
|
||||
|
||||
import { test } from "./lib/fixtures";
|
||||
import { localize } from "./lib/localize";
|
||||
import {
|
||||
bookTimeSlot,
|
||||
localize,
|
||||
submitAndWaitForResponse,
|
||||
selectFirstAvailableTimeSlotNextMonth,
|
||||
setupManagedEvent,
|
||||
|
||||
@@ -8,7 +8,8 @@ import prisma from "@calcom/prisma";
|
||||
import { MembershipRole } from "@calcom/prisma/enums";
|
||||
|
||||
import { test } from "./lib/fixtures";
|
||||
import { submitAndWaitForResponse, localize } from "./lib/testUtils";
|
||||
import { localize } from "./lib/localize";
|
||||
import { submitAndWaitForResponse } from "./lib/testUtils";
|
||||
|
||||
test.describe.configure({ mode: "parallel" });
|
||||
test.afterEach(async ({ users }) => {
|
||||
|
||||
@@ -6,7 +6,8 @@ import { APP_NAME, IS_PREMIUM_USERNAME_ENABLED, IS_MAILHOG_ENABLED } from "@calc
|
||||
import prisma from "@calcom/prisma";
|
||||
|
||||
import { test } from "./lib/fixtures";
|
||||
import { getEmailsReceivedByUser, localize } from "./lib/testUtils";
|
||||
import { localize } from "./lib/localize";
|
||||
import { getEmailsReceivedByUser } from "./lib/testUtils";
|
||||
import { expectInvitationEmailToBeReceived } from "./team/expects";
|
||||
|
||||
test.describe.configure({ mode: "parallel" });
|
||||
|
||||
@@ -5,7 +5,8 @@ import { prisma } from "@calcom/prisma";
|
||||
import { MembershipRole, SchedulingType } from "@calcom/prisma/enums";
|
||||
|
||||
import { test } from "../lib/fixtures";
|
||||
import { getInviteLink, localize } from "../lib/testUtils";
|
||||
import { localize } from "../lib/localize";
|
||||
import { getInviteLink } from "../lib/testUtils";
|
||||
import { expectInvitationEmailToBeReceived } from "./expects";
|
||||
|
||||
test.describe.configure({ mode: "parallel" });
|
||||
|
||||
Reference in new issue
Block a user