@@ -6,29 +6,23 @@ import {
6
6
assertNoRequestIsBlocked ,
7
7
bookFirstEvent ,
8
8
deleteAllBookingsByEmail ,
9
- getEmbedIframe ,
9
+ ensureEmbedIframe ,
10
10
} from "../lib/testUtils" ;
11
11
12
12
test . describe ( "Inline Iframe" , ( ) => {
13
- test ( "Inline Iframe - Configured with Dark Theme. Do booking and verify that COEP/CORP headers are correctly set" , async ( {
13
+ test ( "Configured with Dark Theme. Do booking and verify that COEP/CORP headers are correctly set" , async ( {
14
14
page,
15
- embeds : { addEmbedListeners , getActionFiredDetails } ,
15
+ embeds,
16
16
} ) => {
17
17
await deleteAllBookingsByEmail ( "embed-user@example.com" ) ;
18
- await addEmbedListeners ( "" ) ;
19
- await page . goto ( "/?only=ns:default" ) ;
18
+ await embeds . gotoPlayground ( { calNamespace : "" , url : "/?only=ns:default" } ) ;
20
19
const calNamespace = "" ;
21
- const embedIframe = await getEmbedIframe ( { calNamespace, page, pathname : "/pro" } ) ;
22
- expect ( embedIframe ) . toBeEmbedCalLink ( calNamespace , getActionFiredDetails , {
23
- pathname : "/pro" ,
20
+ const embedIframe = await ensureEmbedIframe ( { calNamespace, page, pathname : "/pro" } ) ;
21
+ expect ( embedIframe ) . toBeEmbedCalLink ( calNamespace , embeds . getActionFiredDetails , {
24
22
searchParams : {
25
23
theme : "dark" ,
26
24
} ,
27
25
} ) ;
28
- // expect(await page.screenshot()).toMatchSnapshot("event-types-list.png");
29
- if ( ! embedIframe ) {
30
- throw new Error ( "Embed iframe not found" ) ;
31
- }
32
26
33
27
assertNoRequestIsBlocked ( page ) ;
34
28
@@ -57,6 +51,17 @@ test.describe("Inline Iframe", () => {
57
51
} ) ;
58
52
} ) ;
59
53
54
+ test ( "Ensure iframe doesn't hijack scroll in embed mode" , async ( { page, embeds, users } ) => {
55
+ const user = await users . create ( ) ;
56
+ const calNamespace = "autoScrollTest" ;
57
+ await embeds . gotoPlayground ( { calNamespace, url : `?only=ns:autoScrollTest` } ) ;
58
+ const calLink = `${ user . username } /multiple-duration` ;
59
+ await page . goto ( `/?only=ns:autoScrollTest&cal-link=${ calLink } ` ) ;
60
+ const embedIframe = await ensureEmbedIframe ( { calNamespace, page, pathname : `/${ calLink } ` } ) ;
61
+ const finalScrollPosition = await page . evaluate ( ( ) => window . scrollY ) ;
62
+ expect ( finalScrollPosition ) . toBe ( 0 ) ;
63
+ } ) ;
64
+
60
65
todo (
61
66
"Ensure that on all pages - [user], [user]/[type], team/[slug], team/[slug]/book, UI styling works if these pages are directly linked in embed"
62
67
) ;
0 commit comments