Skip to content

fix: flaky e2e test #20757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions apps/web/app/(booking-page-wrapper)/[user]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@ import { withAppDirSsr } from "app/WithAppDirSsr";
import type { PageProps } from "app/_types";
import { generateMeetingMetadata } from "app/_utils";
import { headers, cookies } from "next/headers";
import { cache } from "react";

import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains";

import { buildLegacyCtx, decodeParams } from "@lib/buildLegacyCtx";
import { buildLegacyCtx } from "@lib/buildLegacyCtx";

import { getServerSideProps } from "@server/lib/[user]/getServerSideProps";

import type { PageProps as LegacyPageProps } from "~/users/views/users-public-view";
import LegacyPage from "~/users/views/users-public-view";

const getCtx = cache(async (params: PageProps["params"], searchParams: PageProps["searchParams"]) => {
return buildLegacyCtx(await headers(), await cookies(), await params, await searchParams);
});

export const generateMetadata = async ({ params, searchParams }: PageProps) => {
const props = await getData(
buildLegacyCtx(await headers(), await cookies(), await params, await searchParams)
);
const ctx = await getCtx(params, searchParams);
const props = await getData(ctx);

const { profile, markdownStrippedBio, isOrgSEOIndexable, entity } = props;
const isOrg = !!profile?.organization;
Expand All @@ -33,7 +37,7 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => {
() => markdownStrippedBio,
false,
getOrgFullOrigin(entity.orgSlug ?? null),
`/${decodeParams(await params).user}`
`/${ctx.params?.user}`
);

return {
Expand All @@ -47,9 +51,8 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => {

const getData = withAppDirSsr<LegacyPageProps>(getServerSideProps);
const ServerPage = async ({ params, searchParams }: PageProps) => {
const props = await getData(
buildLegacyCtx(await headers(), await cookies(), await params, await searchParams)
);
const ctx = await getCtx(params, searchParams);
const props = await getData(ctx);

return <LegacyPage {...props} />;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async function verifyRobotsMetaTag({ page, orgSlug, urls, expectedContent }: Ver

test.describe("Organization Settings", () => {
// Skip these tests for now since the meta tag is being placed in the body instead of the head
test.describe.skip("Setting - 'Allow search engine indexing' inside Org profile settings", async () => {
test.describe("Setting - 'Allow search engine indexing' inside Org profile settings", async () => {
let ctx: TestContext;

test.beforeEach(async ({ users }) => {
Expand Down
Loading