@@ -33,10 +33,19 @@ export type BranchesByRepo = Record<string, string[]>
3333export const waitForAppReady = async ( page : Page , path = appEntryPath ) => {
3434 await page . goto ( path )
3535 await expect ( page . getByRole ( 'heading' , { name : '@knighted/develop' } ) ) . toBeVisible ( )
36- await expect ( page . locator ( '#cdn-loading' ) ) . toHaveAttribute ( 'hidden' , '' )
3736 await expect
38- . poll ( ( ) => page . getByRole ( 'status' , { name : 'App status' } ) . textContent ( ) )
39- . not . toBe ( 'Idle' )
37+ . poll ( async ( ) => {
38+ const statusText = (
39+ await page . getByRole ( 'status' , { name : 'App status' } ) . textContent ( )
40+ ) ?. trim ( )
41+
42+ return (
43+ statusText === 'Rendered' ||
44+ statusText ?. startsWith ( 'Rendered (Type errors:' ) ||
45+ statusText === 'Error'
46+ )
47+ } )
48+ . toBe ( true )
4049}
4150
4251export const waitForInitialRender = async ( page : Page ) => {
@@ -215,7 +224,18 @@ export const connectByotWithSingleRepo = async (page: Page) => {
215224 await page . getByRole ( 'button' , { name : 'Add GitHub token' } ) . click ( )
216225
217226 const repoSelect = page . getByLabel ( 'Pull request repository' )
218- await expect ( repoSelect ) . toBeEnabled ( { timeout : 60_000 } )
227+ await expect ( repoSelect ) . toHaveValue ( 'knightedcodemonkey/develop' )
228+
229+ const pushModeVisible = await page
230+ . getByRole ( 'button' , { name : 'Push commit to active pull request branch' } )
231+ . isVisible ( )
232+
233+ if ( pushModeVisible ) {
234+ await expect ( repoSelect ) . toBeDisabled ( )
235+ } else {
236+ await expect ( repoSelect ) . toBeEnabled ( )
237+ }
238+
219239 await expect ( repoSelect ) . toHaveValue ( 'knightedcodemonkey/develop' )
220240
221241 await expect (
0 commit comments