Skip to content

Commit

Permalink
fix: type error (calcom#12808)
Browse files Browse the repository at this point in the history
* fix: type error

* chore

* Dont run future tests

* Skip more tests

* Fix 404 text

* Fix more tests

---------

Co-authored-by: Hariom <[email protected]>
  • Loading branch information
Udit-takkar and hariombalhara authored Dec 15, 2023
1 parent b778b29 commit 6e829e2
Show file tree
Hide file tree
Showing 27 changed files with 36 additions and 31 deletions.
2 changes: 1 addition & 1 deletion apps/web/_app/_trpc/HydrateClient.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { createHydrateClient } from "app/_trpc/createHydrateClient";
import { createHydrateClient } from "_app/_trpc/createHydrateClient";
import superjson from "superjson";

export const HydrateClient = createHydrateClient({
Expand Down
4 changes: 2 additions & 2 deletions apps/web/_app/_trpc/trpc-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type DehydratedState, QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { HydrateClient } from "app/_trpc/HydrateClient";
import { trpc } from "app/_trpc/client";
import { HydrateClient } from "_app/_trpc/HydrateClient";
import { trpc } from "_app/_trpc/client";
import { useState } from "react";
import superjson from "superjson";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import AppPage from "@pages/apps/[slug]/index";
import { Prisma } from "@prisma/client";
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";
import fs from "fs";
import matter from "gray-matter";
import { notFound } from "next/navigation";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SetupPage from "@pages/apps/[slug]/setup";
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";
import type { GetServerSidePropsContext } from "next";
import { cookies, headers } from "next/headers";
import { notFound, redirect } from "next/navigation";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import CategoryPage from "@pages/apps/categories/[category]";
import { Prisma } from "@prisma/client";
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";
import { notFound } from "next/navigation";
import z from "zod";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import LegacyPage from "@pages/apps/categories/index";
import { ssrInit } from "app/_trpc/ssrInit";
import { _generateMetadata } from "app/_utils";
import { ssrInit } from "_app/_trpc/ssrInit";
import { _generateMetadata } from "_app/_utils";
import { cookies, headers } from "next/headers";

import { getAppRegistry, getAppRegistryWithCredentials } from "@calcom/app-store/_appRegistry";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import LegacyPage from "@pages/apps/installed/[category]";
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";
import { notFound } from "next/navigation";
import { z } from "zod";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Page from "@pages/settings/admin/apps/[category]";
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";

export const generateMetadata = async () =>
await _generateMetadata(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Page from "@pages/settings/admin/apps/index";
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";

export const generateMetadata = async () =>
await _generateMetadata(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Page from "@pages/settings/admin/flags";
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";

export const generateMetadata = async () =>
await _generateMetadata(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Page from "@pages/settings/admin/impersonation";
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";

export const generateMetadata = async () =>
await _generateMetadata(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Page from "@pages/settings/admin/oAuth/index";
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";

export const generateMetadata = async () =>
await _generateMetadata(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Page from "@pages/settings/admin/index";
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";

export const generateMetadata = async () =>
await _generateMetadata(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import EventTypes from "@pages/event-types";
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";

export const generateMetadata = async () =>
await _generateMetadata(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Page from "@pages/settings/admin/oAuth/oAuthView";
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";

export const generateMetadata = async () =>
await _generateMetadata(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";

import Page from "@calcom/features/ee/organizations/pages/settings/admin/AdminOrgPage";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getServerCaller } from "app/_trpc/serverClient";
import { type Params } from "app/_types";
import { _generateMetadata } from "app/_utils";
import { getServerCaller } from "_app/_trpc/serverClient";
import { type Params } from "_app/_types";
import { _generateMetadata } from "_app/_utils";
import { cookies, headers } from "next/headers";
import { z } from "zod";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";

import Page from "@calcom/features/ee/users/pages/users-add-view";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { _generateMetadata } from "app/_utils";
import { _generateMetadata } from "_app/_utils";

import Page from "@calcom/features/ee/users/pages/users-listing-view";

Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/app-providers-app-dir.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TooltipProvider } from "@radix-ui/react-tooltip";
import { TrpcProvider } from "app/_trpc/trpc-provider";
import { TrpcProvider } from "_app/_trpc/trpc-provider";
import { dir } from "i18next";
import type { Session } from "next-auth";
import { SessionProvider, useSession } from "next-auth/react";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/playwright/ab-tests-redirect.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { test } from "./lib/fixtures";

test.describe.configure({ mode: "parallel" });

test.describe("apps/ A/B tests", () => {
test.describe.skip("apps/ A/B tests", () => {
test("should point to the /future/apps/installed/[category]", async ({ page, users, context }) => {
await context.addCookies([
{
Expand Down
2 changes: 1 addition & 1 deletion apps/web/playwright/event-types.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { bookTimeSlot, createNewEventType, selectFirstAvailableTimeSlotNextMonth
test.describe.configure({ mode: "parallel" });

test.describe("Event Types A/B tests", () => {
test("should point to the /future/event-types page", async ({ page, users, context }) => {
test.skip("should point to the /future/event-types page", async ({ page, users, context }) => {
await context.addCookies([
{
name: "x-calcom-future-routes-override",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/playwright/lib/future-legacy-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test } from "./fixtures";

export type RouteVariant = "future" | "legacy";

const routeVariants = ["future", "legacy"];
const routeVariants = [/*"future",*/ "legacy"];

/**
* Small wrapper around test.describe().
Expand Down
4 changes: 4 additions & 0 deletions apps/web/playwright/lib/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,3 +336,7 @@ export async function fillStripeTestCheckout(page: Page) {
await page.fill("[name=billingName]", "Stripe Stripeson");
await page.click(".SubmitButton--complete-Shimmer");
}

// When App directory is there, this is the 404 page text. It is commented till it's disabled
// export const NotFoundPageText = "This page could not be found";
export const NotFoundPageText = "ERROR 404";
2 changes: 1 addition & 1 deletion apps/web/playwright/settings-admin.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { test } from "./lib/fixtures";
test.describe.configure({ mode: "parallel" });

test.describe("Settings/admin A/B tests", () => {
test("should point to the /future/settings/admin page", async ({ page, users, context }) => {
test.skip("should point to the /future/settings/admin page", async ({ page, users, context }) => {
await context.addCookies([
{
name: "x-calcom-future-routes-override",
Expand Down
3 changes: 2 additions & 1 deletion apps/web/playwright/teams.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { MembershipRole, SchedulingType } from "@calcom/prisma/enums";

import { test } from "./lib/fixtures";
import {
NotFoundPageText,
bookTimeSlot,
fillStripeTestCheckout,
selectFirstAvailableTimeSlotNextMonth,
Expand Down Expand Up @@ -352,7 +353,7 @@ test.describe("Teams - Org", () => {

await page.goto(`/team/${team.slug}/${teamEventSlug}`);

await expect(page.locator("text=This page could not be found")).toBeVisible();
await expect(page.locator(`text=${NotFoundPageText}`)).toBeVisible();
await doOnOrgDomain(
{
orgSlug: org.slug,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { expect } from "@playwright/test";

import type { Fixtures } from "@calcom/web/playwright/lib/fixtures";
import { test } from "@calcom/web/playwright/lib/fixtures";
import { gotoRoutingLink } from "@calcom/web/playwright/lib/testUtils";
import { NotFoundPageText, gotoRoutingLink } from "@calcom/web/playwright/lib/testUtils";

import {
addForm,
Expand Down Expand Up @@ -36,7 +36,7 @@ test.describe("Routing Forms", () => {
await page.goto(`apps/routing-forms/route-builder/${formId}`);
await disableForm(page);
await gotoRoutingLink({ page, formId });
await expect(page.locator("text=This page could not be found")).toBeVisible();
await expect(page.locator(`text=${NotFoundPageText}`)).toBeVisible();
});

test("should be able to edit the form", async ({ page }) => {
Expand Down

0 comments on commit 6e829e2

Please sign in to comment.