@@ -11,13 +11,13 @@ const mockProtectSettings = async (page: Page, config?: ProtectConfigJSON) => {
1111 const json = await response . json ( ) ;
1212 const newJson = {
1313 ...json ,
14- protect_config : config ,
14+ ... ( config ? { protect_config : config } : { } ) ,
1515 } ;
1616 await route . fulfill ( { response, json : newJson } ) ;
1717 } ) ;
1818} ;
1919
20- testAgainstRunningApps ( { withEnv : [ appConfigs . envs . withEmailCodes ] } ) ( 'Clerk Protect checks' , ( { app } ) => {
20+ testAgainstRunningApps ( { withEnv : [ appConfigs . envs . withEmailCodes ] } ) ( 'Clerk Protect checks @generic ' , ( { app } ) => {
2121 test . describe . configure ( { mode : 'parallel' } ) ;
2222
2323 test . afterAll ( async ( ) => {
@@ -37,14 +37,17 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Clerk Pro
3737 } ) ;
3838 await u . page . goToAppHome ( ) ;
3939 await u . page . waitForClerkJsLoaded ( ) ;
40+
4041 await expect ( page . locator ( '#test-protect-loader' ) ) . toHaveAttribute ( 'type' , 'module' ) ;
4142 } ) ;
4243
4344 test ( 'should not create loader element when protect_config.loader is not set' , async ( { page, context } ) => {
4445 const u = createTestUtils ( { app, page, context } ) ;
45- await mockProtectSettings ( page , undefined ) ;
46+ await mockProtectSettings ( page ) ;
4647 await u . page . goToAppHome ( ) ;
4748 await u . page . waitForClerkJsLoaded ( ) ;
48- expect ( page . locator ( '#test-protect-loader' ) ) . toBeUndefined ( ) ;
49+
50+ // Playwright locators are always objects, never undefined
51+ await expect ( page . locator ( '#test-protect-loader' ) ) . toHaveCount ( 0 ) ;
4952 } ) ;
5053} ) ;
0 commit comments