From 43b3d684475508782d6fb23cdb748b047a393447 Mon Sep 17 00:00:00 2001 From: Keith Williams Date: Thu, 24 Aug 2023 10:12:53 +0200 Subject: [PATCH] chore: Don't render certain components when running meticulous tests (#10772) * chore: Don't render credits when running meticulous tests * fix: type window Meticulous * fix: window reference error * chore: window interface * chore: disable tzdialog popup on meticulous * chore: IS_VISUAL_REGRESSION_TESTING * fix: constants * fix: only run on preview builds --------- Co-authored-by: Shivam Kalra --- .../components/eventtype/EventAdvancedTab.tsx | 63 ++++++++++--------- apps/web/constants.ts | 1 + apps/web/pages/_document.tsx | 2 +- .../settings/TimezoneChangeDialog.tsx | 3 +- packages/features/shell/Shell.tsx | 3 +- packages/types/window.d.ts | 5 ++ 6 files changed, 44 insertions(+), 33 deletions(-) create mode 100644 apps/web/constants.ts create mode 100644 packages/types/window.d.ts diff --git a/apps/web/components/eventtype/EventAdvancedTab.tsx b/apps/web/components/eventtype/EventAdvancedTab.tsx index 2d5f17c66d..540021f92a 100644 --- a/apps/web/components/eventtype/EventAdvancedTab.tsx +++ b/apps/web/components/eventtype/EventAdvancedTab.tsx @@ -35,6 +35,7 @@ import { Tooltip, } from "@calcom/ui"; import { Copy, Edit } from "@calcom/ui/components/icon"; +import { IS_VISUAL_REGRESSION_TESTING } from "@calcom/web/constants"; import RequiresConfirmationController from "./RequiresConfirmationController"; @@ -286,36 +287,38 @@ export const EventAdvancedTab = ({ eventType, team }: Pick {/* Textfield has some margin by default we remove that so we can keep consitant aligment */}
- - - - } - /> + {!IS_VISUAL_REGRESSION_TESTING && ( + + + + } + /> + )}

diff --git a/apps/web/constants.ts b/apps/web/constants.ts new file mode 100644 index 0000000000..c19877c5ef --- /dev/null +++ b/apps/web/constants.ts @@ -0,0 +1 @@ +export const IS_VISUAL_REGRESSION_TESTING = Boolean(globalThis.window?.Meticulous?.isRunningAsTest); diff --git a/apps/web/pages/_document.tsx b/apps/web/pages/_document.tsx index 3d6fdae736..006b73c8fa 100644 --- a/apps/web/pages/_document.tsx +++ b/apps/web/pages/_document.tsx @@ -51,7 +51,7 @@ class MyDocument extends Document { - {(!IS_PRODUCTION || process.env.VERCEL_ENV === "preview") && ( + {!IS_PRODUCTION && process.env.VERCEL_ENV === "preview" && ( // eslint-disable-next-line @next/next/no-sync-scripts