Update all Yarn dependencies (2022-05-16) (#2769)

* Update all Yarn dependencies (2022-05-16)

* Upgrade dependencies

* Removes deprecated packages

* Upgrades deps

* Updates submodules

* Update yarn.lock

* Linting

* Linting

* Update website

* Build fixes

* TODO: fix this

* Module resolving

* Type fixes

* Intercom fixes on SSG

* Fixes infinite loop

* Upgrades to React 18

* Type fixes

* Locks node version to 14

* Upgrades daily-js

* Readds missing types

* Upgrades playwright

* Noop when intercom is not installed

* Update website

* Removed yarn.lock in favor of monorepo

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: zomars <[email protected]>
This commit is contained in:
depfu[bot]andzomars authored and GitHub committed 2022-05-17 19:31:49 +00:00
1 parent 683e8c4490
commit db01f7be19
60 files changed
+1719 -21327

No files matched your search

Submodule apps/api updated: be2d4338ee...64f5ac5723.
+4 -4
View File
@@ -16,14 +16,14 @@
"license": "MIT",
"dependencies": {
"iframe-resizer-react": "^1.1.0",
"next": "^12.1.0",
"next": "^12.1.6",
"nextra": "^1.1.0",
"nextra-theme-docs": "^1.2.2",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "^18.1.0",
"react-dom": "^18.1.0"
},
"devDependencies": {
"@calcom/config": "*",
"eslint": "^8.10.0"
"eslint": "^8.15.0"
}
}
-3623
View File
File diff suppressed because it is too large. Load diff
+8 -8
View File
@@ -10,16 +10,16 @@
"dependencies": {
"highlight.js": "^11.5.1",
"isarray": "2.0.5",
"next": "12.1.5",
"next": "12.1.6",
"openapi-snippet": "^0.13.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"swagger-ui-react": "4.10.3"
"react": "18.1.0",
"react-dom": "18.1.0",
"swagger-ui-react": "4.11.1"
},
"devDependencies": {
"@types/node": "17.0.27",
"@types/react": "17.0.43",
"@types/react-dom": "17.0.14",
"typescript": "4.6.3"
"@types/node": "14.17.6",
"@types/react": "18.0.9",
"@types/react-dom": "18.0.4",
"typescript": "4.6.4"
}
}
File diff suppressed because it is too large. Load diff
+6 -5
View File
@@ -2,7 +2,7 @@ import { FormEvent, useCallback, useEffect, useState } from "react";
import Cropper from "react-easy-crop";
import Button from "@calcom/ui/Button";
import { DialogClose, DialogTrigger, Dialog, DialogContent } from "@calcom/ui/Dialog";
import { Dialog, DialogClose, DialogContent, DialogTrigger } from "@calcom/ui/Dialog";
import { Area, getCroppedImg } from "@lib/cropImage";
import { useFileReader } from "@lib/hooks/useFileReader";
@@ -71,15 +71,15 @@ export default function ImageUploader({
...props
}: ImageUploaderProps) {
const { t } = useLocale();
const [imageSrc, setImageSrc] = useState<string | null>();
const [croppedAreaPixels, setCroppedAreaPixels] = useState<Area | null>();
const [imageSrc, setImageSrc] = useState<string | null>(null);
const [croppedAreaPixels, setCroppedAreaPixels] = useState<Area | null>(null);
const [{ result }, setFile] = useFileReader({
method: "readAsDataURL",
});
useEffect(() => {
setImageSrc(props.imageSrc);
if (props.imageSrc) setImageSrc(props.imageSrc);
}, [props.imageSrc]);
const onInputFile = (e: FileEvent<HTMLInputElement>) => {
@@ -90,8 +90,9 @@ export default function ImageUploader({
};
const showCroppedImage = useCallback(
async (croppedAreaPixels) => {
async (croppedAreaPixels: Area | null) => {
try {
if (!croppedAreaPixels) return;
const croppedImage = await getCroppedImg(
result as string /* result is always string when using readAsDataUrl */,
croppedAreaPixels
+3 -2
View File
@@ -1,9 +1,10 @@
import { AdminRequired } from "components/ui/AdminRequired";
import Link, { LinkProps } from "next/link";
import { useRouter } from "next/router";
import React, { ElementType, FC, Fragment, MouseEventHandler } from "react";
import { FC, Fragment, MouseEventHandler } from "react";
import classNames from "@lib/classNames";
import { SVGComponent } from "@lib/types/SVGComponent";
export interface NavTabProps {
tabs: {
@@ -12,7 +13,7 @@ export interface NavTabProps {
href?: string;
/** If you want to change query param tabName as per current tab */
tabName?: string;
icon?: ElementType;
icon?: SVGComponent;
adminRequired?: boolean;
}[];
linkProps?: Omit<LinkProps, "href">;
+2 -2
View File
@@ -1,7 +1,7 @@
import { ChevronLeftIcon, ChevronRightIcon } from "@heroicons/react/solid";
import { EventType, PeriodType } from "@prisma/client";
import dayjs, { Dayjs } from "dayjs";
import dayjsBusinessTime from "dayjs-business-time";
import dayjsBusinessTime from "dayjs-business-days2";
import timezone from "dayjs/plugin/timezone";
import utc from "dayjs/plugin/utc";
import { memoize } from "lodash";
@@ -56,7 +56,7 @@ function isOutOfBounds(
case PeriodType.ROLLING: {
const periodRollingEndDay = periodCountCalendarDays
? dayjs().utcOffset(date.utcOffset()).add(periodDays!, "days").endOf("day")
: dayjs().utcOffset(date.utcOffset()).addBusinessTime(periodDays!, "days").endOf("day");
: dayjs().utcOffset(date.utcOffset()).businessDaysAdd(periodDays!).endOf("day");
return date.endOf("day").isAfter(periodRollingEndDay);
}
@@ -118,7 +118,6 @@ export default function TeamSettingsRightSidebar(props: { team: TeamWithMembers;
)}
</div>
{props.team?.id && props.role !== MembershipRole.MEMBER && (
// eslint-disable-next-line @next/next/link-passhref
<Link href={`/settings/teams/${props.team.id}/availability`}>
<div className="mt-5 hidden space-y-1 sm:block">
<LinkIconButton Icon={ClockIcon}>{"View Availability"}</LinkIconButton>
@@ -37,7 +37,6 @@ const Team = ({ team }: TeamPageProps) => {
);
return (
// eslint-disable-next-line @next/next/link-passhref
<Link key={member.id} href={`/${member.username}`}>
<div className={classes}>
<ArrowRightIcon
+1
View File
@@ -3,6 +3,7 @@ import { FC, Fragment } from "react";
type AdminRequiredProps = {
as?: keyof JSX.IntrinsicElements;
children?: React.ReactNode;
};
export const AdminRequired: FC<AdminRequiredProps> = ({ children, as, ...rest }) => {
@@ -36,7 +36,7 @@ type ChildrenProps = {
props: RadioAreaProps;
children?: ReactNode;
};
interface RadioAreaGroupProps extends Omit<React.ComponentPropsWithoutRef<"div">, "onChange"> {
interface RadioAreaGroupProps extends Omit<React.ComponentPropsWithoutRef<"div">, "onChange" | "children"> {
children: ChildrenProps | ChildrenProps[];
name?: string;
onChange?: (value: string) => void;
@@ -100,8 +100,10 @@ export default function TeamAvailabilityScreen(props: Props) {
</div>
</div>
<div className="flex h-full flex-1">
{/* @ts-ignore */}
<AutoSizer>
{({ height, width }) => (
// @ts-ignore
<List
itemSize={240}
itemCount={props.team?.members?.length ?? 0}
@@ -93,7 +93,7 @@ const CryptoSection = (props: CryptoSectionProps) => {
const verifyButton = useMemo(() => {
return (
<Button color="secondary" onClick={verifyWallet} type="button" id="hasToken" name="hasToken">
<Button color="secondary" onClick={verifyWallet} type="button" id="hasToken">
{
// eslint-disable-next-line @next/next/no-img-element
<img className="mr-1 h-5" src="/apps/metamask.svg" alt="MetaMask" />
+1 -1
View File
@@ -1,7 +1,7 @@
import { FC } from "react";
import { LiveChatLoaderProvider } from "react-live-chat-loader";
const Provider: FC = ({ children }) => (
const Provider: FC<{ children: React.ReactNode }> = ({ children }) => (
<LiveChatLoaderProvider providerKey={process.env.NEXT_PUBLIC_HELPSCOUT_KEY!} provider="helpScout">
<>{children}</>
</LiveChatLoaderProvider>
@@ -1,11 +1,12 @@
import { ChatAltIcon } from "@heroicons/react/solid";
import { useIntercom } from "react-use-intercom";
import { DropdownMenuItem } from "@calcom/ui/Dropdown";
import classNames from "@lib/classNames";
import { useLocale } from "@lib/hooks/useLocale";
import { useIntercom } from "./useIntercom";
export default function IntercomMenuItem() {
const { t } = useLocale();
const { boot, show } = useIntercom();
+1 -1
View File
@@ -1,7 +1,7 @@
import { FC } from "react";
import { IntercomProvider } from "react-use-intercom";
const Provider: FC = ({ children }) => (
const Provider: FC<{ children: React.ReactNode }> = ({ children }) => (
<IntercomProvider appId={process.env.NEXT_PUBLIC_INTERCOM_APP_ID!}>{children}</IntercomProvider>
);
+11
View File
@@ -0,0 +1,11 @@
import { useIntercom as _useIntercom } from "react-use-intercom";
export const useIntercom =
typeof window !== "undefined" && !!process.env.NEXT_PUBLIC_INTERCOM_APP_ID
? _useIntercom
: () => ({
boot: () => {},
show: () => {},
});
export default useIntercom;
+4 -2
View File
@@ -1,6 +1,6 @@
import { SessionProvider } from "next-auth/react";
import { appWithTranslation } from "next-i18next";
import type { AppProps as NextAppProps } from "next/app";
import type { AppProps as NextAppProps, AppProps as NextJsAppProps } from "next/app";
import { ComponentProps, ReactNode, useMemo } from "react";
import DynamicHelpscoutProvider from "@ee/lib/helpscout/providerDynamic";
@@ -11,7 +11,9 @@ import { createTelemetryClient, TelemetryProvider } from "@lib/telemetry";
import { trpc } from "./trpc";
const I18nextAdapter = appWithTranslation(({ children }: { children?: ReactNode }) => <>{children}</>);
const I18nextAdapter = appWithTranslation<NextJsAppProps & { children: React.ReactNode }>(({ children }) => (
<>{children}</>
));
// Workaround for https://github.com/vercel/next.js/issues/8592
export type AppProps = NextAppProps & {
+44 -45
View File
@@ -30,21 +30,21 @@
"@calcom/app-store": "*",
"@calcom/core": "*",
"@calcom/ee": "*",
"@calcom/embed-core": "*",
"@calcom/lib": "*",
"@calcom/prisma": "*",
"@calcom/stripe": "*",
"@calcom/tsconfig": "*",
"@calcom/ui": "*",
"@calcom/embed-core": "*",
"@daily-co/daily-js": "^0.21.0",
"@daily-co/daily-js": "^0.26.0",
"@glidejs/glide": "^3.5.2",
"@heroicons/react": "^1.0.6",
"@hookform/error-message": "^2.0.0",
"@hookform/resolvers": "^2.8.5",
"@hookform/resolvers": "^2.8.9",
"@jitsu/sdk-js": "^2.2.4",
"@metamask/providers": "^8.1.1",
"@next-auth/prisma-adapter": "^1.0.3",
"@next/bundle-analyzer": "12.1.0",
"@next/bundle-analyzer": "12.1.6",
"@radix-ui/react-avatar": "^0.1.0",
"@radix-ui/react-collapsible": "^0.1.0",
"@radix-ui/react-dialog": "^0.1.0",
@@ -54,20 +54,20 @@
"@radix-ui/react-slider": "^0.1.1",
"@radix-ui/react-switch": "^0.1.1",
"@radix-ui/react-tooltip": "^0.1.0",
"@stripe/react-stripe-js": "^1.4.1",
"@stripe/stripe-js": "^1.16.0",
"@trpc/client": "^9.22.0",
"@trpc/next": "^9.22.0",
"@trpc/react": "^9.22.0",
"@trpc/server": "^9.22.0",
"@stripe/react-stripe-js": "^1.8.0",
"@stripe/stripe-js": "^1.29.0",
"@trpc/client": "^9.23.4",
"@trpc/next": "^9.23.4",
"@trpc/react": "^9.23.4",
"@trpc/server": "^9.23.4",
"@vercel/edge-functions-ui": "^0.2.1",
"@wojtekmaj/react-daterange-picker": "^3.3.1",
"accept-language-parser": "^1.5.0",
"async": "^3.2.1",
"bcryptjs": "^2.4.3",
"classnames": "^2.3.1",
"dayjs": "^1.10.4",
"dayjs-business-time": "^1.0.4",
"dayjs": "^1.11.2",
"dayjs-business-days2": "^1.1.0",
"googleapis": "^84.0.0",
"gray-matter": "^4.0.3",
"handlebars": "^4.7.7",
@@ -78,78 +78,77 @@
"lodash": "^4.17.21",
"micro": "^9.3.4",
"mime-types": "^2.1.35",
"next": "^12.1.0",
"next-auth": "^4.3.3",
"next-i18next": "^8.9.0",
"next-mdx-remote": "^4.0.2",
"next": "^12.1.6",
"next-auth": "^4.3.4",
"next-i18next": "^11.0.0",
"next-mdx-remote": "^4.0.3",
"next-seo": "^4.26.0",
"next-transpile-modules": "^9.0.0",
"nodemailer": "^6.7.2",
"nodemailer": "^6.7.5",
"otplib": "^12.0.1",
"qrcode": "^1.5.0",
"react": "^17.0.2",
"react": "^18.1.0",
"react-colorful": "^5.5.1",
"react-date-picker": "^8.3.6",
"react-digit-input": "^2.1.0",
"react-dom": "^17.0.2",
"react-dom": "^18.1.0",
"react-easy-crop": "^3.5.2",
"react-hook-form": "^7.29.0",
"react-hook-form": "^7.31.1",
"react-hot-toast": "^2.1.0",
"react-intl": "^5.22.0",
"react-intl": "^5.25.1",
"react-live-chat-loader": "^2.7.3",
"react-multi-email": "^0.5.3",
"react-phone-number-input": "^3.1.41",
"react-query": "^3.33.7",
"react-router-dom": "^5.2.0",
"react-select": "^5.2.1",
"react-phone-number-input": "^3.1.52",
"react-query": "^3.39.0",
"react-select": "^5.3.2",
"react-timezone-select": "^1.3.1",
"react-use-intercom": "1.4.0",
"react-use-intercom": "1.5.1",
"react-virtualized-auto-sizer": "^1.0.6",
"react-window": "^1.8.6",
"react-window": "^1.8.7",
"rrule": "^2.6.9",
"short-uuid": "^4.2.0",
"stripe": "^8.191.0",
"superjson": "1.8.1",
"stripe": "^9.1.0",
"superjson": "1.9.1",
"uuid": "^8.3.2",
"web3": "^1.6.1",
"zod": "^3.14.4"
"web3": "^1.7.3",
"zod": "^3.16.0"
},
"devDependencies": {
"@babel/core": "^7.17.8",
"@babel/core": "^7.17.10",
"@calcom/config": "*",
"@calcom/types": "*",
"@microsoft/microsoft-graph-types-beta": "0.15.0-preview",
"@playwright/test": "^1.18.1",
"@playwright/test": "^1.22.1",
"@types/accept-language-parser": "1.5.2",
"@types/async": "^3.2.10",
"@types/async": "^3.2.13",
"@types/bcryptjs": "^2.4.2",
"@types/glidejs__glide": "^3.4.1",
"@types/jest": "^27.0.3",
"@types/lodash": "^4.14.177",
"@types/micro": "^7.3.6",
"@types/glidejs__glide": "^3.4.2",
"@types/jest": "^27.5.1",
"@types/lodash": "^4.14.182",
"@types/micro": "7.3.6",
"@types/mime-types": "^2.1.1",
"@types/module-alias": "^2.0.1",
"@types/node": "^16.11.24",
"@types/node": "14.17.6",
"@types/nodemailer": "^6.4.4",
"@types/qrcode": "^1.4.1",
"@types/react": "^17.0.37",
"@types/react": "18.0.9",
"@types/react-phone-number-input": "^3.0.13",
"@types/react-virtualized-auto-sizer": "^1.0.1",
"@types/react-window": "^1.8.5",
"@types/stripe": "^8.0.417",
"@types/uuid": "8.3.1",
"autoprefixer": "^10.4.0",
"autoprefixer": "^10.4.7",
"babel-jest": "^27.3.1",
"env-cmd": "10.1.0",
"eslint": "^8.10.0",
"eslint": "^8.15.0",
"jest": "^26.0.0",
"mockdate": "^3.0.5",
"module-alias": "^2.2.2",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.4",
"tailwindcss": "^3.0.23",
"postcss": "^8.4.13",
"tailwindcss": "^3.0.24",
"ts-jest": "^26.0.0",
"ts-node": "^10.6.0",
"typescript": "^4.5.3"
"typescript": "^4.6.4"
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
import { BookingStatus, Credential, Prisma, SchedulingType, WebhookTriggerEvents } from "@prisma/client";
import async from "async";
import dayjs from "dayjs";
import dayjsBusinessTime from "dayjs-business-time";
import dayjsBusinessTime from "dayjs-business-days2";
import isBetween from "dayjs/plugin/isBetween";
import timezone from "dayjs/plugin/timezone";
import utc from "dayjs/plugin/utc";
@@ -114,7 +114,7 @@ function isOutOfBounds(
case "rolling": {
const periodRollingEndDay = periodCountCalendarDays
? dayjs().tz(timeZone).add(periodDays, "days").endOf("day")
: dayjs().tz(timeZone).addBusinessTime(periodDays, "days").endOf("day");
: dayjs().tz(timeZone).businessDaysAdd(periodDays).endOf("day");
return date.endOf("day").isAfter(periodRollingEndDay);
}
+7 -10
View File
@@ -63,16 +63,13 @@ export default function Page({ resetPasswordRequest, csrfToken }: Props) {
</h2>
</div>
<p>{t("password_has_been_reset_login")}</p>
{
// eslint-disable-next-line @next/next/link-passhref
<Link href="/auth/login">
<button
type="button"
className="flex w-full justify-center px-4 py-2 text-sm font-medium text-blue-600 focus:outline-none focus:ring-2 focus:ring-black focus:ring-offset-2">
{t("login")}
</button>
</Link>
}
<Link href="/auth/login">
<button
type="button"
className="flex w-full justify-center px-4 py-2 text-sm font-medium text-blue-600 focus:outline-none focus:ring-2 focus:ring-black focus:ring-offset-2">
{t("login")}
</button>
</Link>
</div>
</>
);
+1 -1
View File
@@ -26,7 +26,7 @@ async function _getStaticProps() {
}
type PageProps = inferSSRProps<typeof _getStaticProps>;
const SandboxPage: NextPage<PageProps> = (props) => {
const SandboxPage: NextPage<PageProps & { children: React.ReactNode }> = (props) => {
return (
<>
<Head>
+1 -1
View File
@@ -1,8 +1,8 @@
import { ExternalLinkIcon } from "@heroicons/react/solid";
import { ReactNode } from "react";
import { useIntercom } from "react-use-intercom";
import Button from "@calcom/ui/Button";
import { useIntercom } from "@ee/lib/intercom/useIntercom";
import { useLocale } from "@lib/hooks/useLocale";
import useMeQuery from "@lib/hooks/useMeQuery";
+18 -16
View File
@@ -4,7 +4,7 @@ import { getSession } from "next-auth/react";
import Head from "next/head";
import Link from "next/link";
import { useRouter } from "next/router";
import React, { useEffect } from "react";
import { useEffect } from "react";
import { useLocale } from "@lib/hooks/useLocale";
import prisma from "@lib/prisma";
@@ -122,21 +122,23 @@ export default function JoinCall(props: JoinCallPageProps) {
<meta property="twitter:description" content={t("quick_video_meeting")} />
</Head>
<div style={{ zIndex: 2, position: "relative" }}>
<Link href="/" passHref>
{
// eslint-disable-next-line @next/next/no-img-element
<img
className="h-5·w-auto fixed z-10 hidden sm:inline-block"
src="https://cal.com/logo-white.svg"
alt="Cal.com Logo"
style={{
top: 46,
left: 24,
}}
/>
}
</Link>
{JoinCall}
<>
<Link href="/" passHref>
{
// eslint-disable-next-line @next/next/no-img-element
<img
className="h-5·w-auto fixed z-10 hidden sm:inline-block"
src="https://cal.com/logo-white.svg"
alt="Cal.com Logo"
style={{
top: 46,
left: 24,
}}
/>
}
</Link>
{JoinCall}
</>
</div>
</>
);
@@ -6,6 +6,7 @@ function chooseEmbedType(page: Page, embedType: string) {
async function gotToPreviewTab(page: Page) {
// To prevent early timeouts
// eslint-disable-next-line playwright/no-wait-for-timeout
await page.waitForTimeout(1000);
await page.locator("[data-testid=embed-tabs]").locator("text=Preview").click();
}
+21 -21
View File
@@ -22,7 +22,7 @@ test.describe("Event Types tests", () => {
test.use({ storageState: "playwright/artifacts/proStorageState.json" });
test("has at least 2 events", async ({ page }) => {
const $eventTypes = await page.locator("[data-testid=event-types] > *");
const $eventTypes = page.locator("[data-testid=event-types] > *");
const count = await $eventTypes.count();
expect(count).toBeGreaterThanOrEqual(2);
@@ -48,7 +48,8 @@ test.describe("Event Types tests", () => {
await page.goto("/event-types");
isCreated = await expect(page.locator(`text='${eventTitle}'`)).toBeVisible();
isCreated = page.locator(`text='${eventTitle}'`);
await expect(isCreated).toBeVisible();
});
test("enabling recurring event comes with default options", async ({ page }) => {
@@ -67,22 +68,21 @@ test.describe("Event Types tests", () => {
});
await page.click("[data-testid=show-advanced-settings]");
await expect(await page.locator("[data-testid=recurring-event-collapsible] > *")).not.toBeVisible();
await expect(page.locator("[data-testid=recurring-event-collapsible] > *")).not.toBeVisible();
await page.click("[data-testid=recurring-event-check]");
isCreated = await expect(
await page.locator("[data-testid=recurring-event-collapsible] > *")
).toBeVisible();
isCreated = page.locator("[data-testid=recurring-event-collapsible] > *");
await expect(isCreated).toBeVisible();
await expect(
expect(
await page
.locator("[data-testid=recurring-event-collapsible] input[type=number]")
.nth(0)
.getAttribute("value")
).toBe("1");
await expect(
expect(
await page.locator("[data-testid=recurring-event-collapsible] div[class$=singleValue]").textContent()
).toBe("week");
await expect(
expect(
await page
.locator("[data-testid=recurring-event-collapsible] input[type=number]")
.nth(1)
@@ -98,21 +98,21 @@ test.describe("Event Types tests", () => {
await page.click("[data-testid=event-type-options-3]");
await page.click("[data-testid=event-type-duplicate-3]");
const url = await page.url();
const url = page.url();
const params = new URLSearchParams(url);
await expect(params.get("title")).toBe(firstTitle);
await expect(params.get("slug")).toBe(firstSlug);
expect(params.get("title")).toBe(firstTitle);
expect(params.get("slug")).toBe(firstSlug);
const formTitle = await page.inputValue("[name=title]");
const formSlug = await page.inputValue("[name=slug]");
await expect(formTitle).toBe(firstTitle);
await expect(formSlug).toBe(firstSlug);
expect(formTitle).toBe(firstTitle);
expect(formSlug).toBe(firstSlug);
});
test("edit first event", async ({ page }) => {
const $eventTypes = await page.locator("[data-testid=event-types] > *");
const firstEventTypeElement = await $eventTypes.first();
const $eventTypes = page.locator("[data-testid=event-types] > *");
const firstEventTypeElement = $eventTypes.first();
await firstEventTypeElement.click();
await page.waitForNavigation({
url: (url) => {
@@ -135,12 +135,12 @@ test.describe("Event Types tests", () => {
test.use({ storageState: "playwright/artifacts/freeStorageState.json" });
test("has at least 2 events where first is enabled", async ({ page }) => {
const $eventTypes = await page.locator("[data-testid=event-types] > *");
const $eventTypes = page.locator("[data-testid=event-types] > *");
const count = await $eventTypes.count();
expect(count).toBeGreaterThanOrEqual(2);
const $first = await $eventTypes.first();
const $last = await $eventTypes.last()!;
const $first = $eventTypes.first();
const $last = $eventTypes.last()!;
expect(await $first.getAttribute("data-disabled")).toBe("0");
expect(await $last.getAttribute("data-disabled")).toBe("1");
});
@@ -150,8 +150,8 @@ test.describe("Event Types tests", () => {
});
test("edit first event", async ({ page }) => {
const $eventTypes = await page.locator("[data-testid=event-types] > *");
const firstEventTypeElement = await $eventTypes.first();
const $eventTypes = page.locator("[data-testid=event-types] > *");
const firstEventTypeElement = $eventTypes.first();
await firstEventTypeElement.click();
await page.waitForNavigation({
url: (url) => {
+1
View File
@@ -140,6 +140,7 @@ export async function login(
await signInLocator.click();
// 2 seconds of delay to give the session enough time for a clean load
// eslint-disable-next-line playwright/no-wait-for-timeout
await page.waitForTimeout(2000);
}
+1
View File
@@ -35,6 +35,7 @@ test.describe("hash my url", () => {
await page.keyboard.press("Enter");
// To prevent an early 404
// eslint-disable-next-line playwright/no-wait-for-timeout
await page.waitForTimeout(1000);
// book using generated url hash
@@ -12,6 +12,7 @@ const IS_STRIPE_ENABLED = !!(
);
test.describe("Stripe integration", () => {
// eslint-disable-next-line playwright/no-skipped-test
test.skip(!IS_STRIPE_ENABLED, "It should only run if Stripe is installed");
test.describe("Stripe integration dashboard", () => {
+3
View File
@@ -2,6 +2,7 @@ import { expect, Page, test } from "@playwright/test";
import { createServer, IncomingMessage, ServerResponse } from "http";
export function todo(title: string) {
// eslint-disable-next-line playwright/no-skipped-test
test.skip(title, () => {});
}
@@ -72,6 +73,7 @@ export async function selectFirstAvailableTimeSlotNextMonth(page: Page) {
// @TODO: Find a better way to make test wait for full month change render to end
// so it can click up on the right day, also when resolve remove other todos
// Waiting for full month increment
// eslint-disable-next-line playwright/no-wait-for-timeout
await page.waitForTimeout(1000);
// TODO: Find out why the first day is always booked on tests
await page.locator('[data-testid="day"][data-disabled="false"]').nth(1).click();
@@ -83,6 +85,7 @@ export async function selectSecondAvailableTimeSlotNextMonth(page: Page) {
// @TODO: Find a better way to make test wait for full month change render to end
// so it can click up on the right day, also when resolve remove other todos
// Waiting for full month increment
// eslint-disable-next-line playwright/no-wait-for-timeout
await page.waitForTimeout(1000);
// TODO: Find out why the first day is always booked on tests
await page.locator('[data-testid="day"][data-disabled="false"]').nth(1).click();
+2
View File
@@ -3,6 +3,7 @@ import { expect, test } from "@playwright/test";
import { IS_GOOGLE_LOGIN_ENABLED, IS_SAML_LOGIN_ENABLED } from "../server/lib/constants";
test("Should display Google Login button", async ({ page }) => {
// eslint-disable-next-line playwright/no-skipped-test
test.skip(!IS_GOOGLE_LOGIN_ENABLED, "It should only run if Google Login is installed");
await page.goto(`${process.env.PLAYWRIGHT_TEST_BASE_URL}/auth/login`);
@@ -11,6 +12,7 @@ test("Should display Google Login button", async ({ page }) => {
});
test("Should display SAML Login button", async ({ page }) => {
// eslint-disable-next-line playwright/no-skipped-test
test.skip(!IS_SAML_LOGIN_ENABLED, "It should only run if SAML Login is installed");
await page.goto(`${process.env.PLAYWRIGHT_TEST_BASE_URL}/auth/login`);
+1
View File
@@ -41,6 +41,7 @@ test.describe("Onboarding", () => {
// Try to go getting started with a available username
await page.goto("/getting-started");
// Wait for useEffectUpdate to run
// eslint-disable-next-line playwright/no-wait-for-timeout
await page.waitForTimeout(1000);
const updatedUser = await prisma.user.findUnique({
+1
View File
@@ -102,6 +102,7 @@ test.describe("Reschedule Tests", async () => {
});
test("Unpaid rescheduling should go to payment page", async ({ page, users, bookings, payments }) => {
// eslint-disable-next-line playwright/no-skipped-test
test.skip(!IS_STRIPE_ENABLED, "Skipped as Stripe is not installed");
const user = await users.create();
await user.login();
+1
View File
@@ -7,6 +7,7 @@ test.describe("SAML tests", () => {
test.use({ storageState: "playwright/artifacts/proStorageState.json" });
test("test SAML configuration UI with [email protected]", async ({ page }) => {
// eslint-disable-next-line playwright/no-skipped-test
test.skip(!IS_SAML_LOGIN_ENABLED, "It should only run if SAML is enabled");
// Try to go Security page
await page.goto("/settings/security");
-12313
View File
File diff suppressed because it is too large. Load diff