@@ -13,12 +13,13 @@ test.describe('Ledger API Integration', () => {
1313 test ( 'journal entries page loads with company selector' , async ( { page } ) => {
1414 await page . goto ( '/accounting/gl-entries' ) ;
1515 await page . waitForLoadState ( 'networkidle' ) ;
16+ await page . waitForTimeout ( 2000 ) ; // Extra buffer for Blazor hydration
1617
17- // Check page title
18- await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Journal Entries' , { timeout : 30000 } ) ;
18+ // Check page title (may take time to load)
19+ await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Journal Entries' , { timeout : 60000 } ) ;
1920
2021 // Check company selector is visible (may take time to load)
21- await expect ( page . locator ( 'select#company-select' ) ) . toBeVisible ( { timeout : 30000 } ) ;
22+ await expect ( page . locator ( 'select#company-select' ) ) . toBeVisible ( { timeout : 60000 } ) ;
2223
2324 // Check date filters are visible after company selection
2425 const companySelect = page . locator ( 'select#company-select' ) ;
@@ -38,12 +39,13 @@ test.describe('Ledger API Integration', () => {
3839 test ( 'trial balance page shows company selector and validation' , async ( { page } ) => {
3940 await page . goto ( '/accounting/trial-balance' ) ;
4041 await page . waitForLoadState ( 'networkidle' ) ;
42+ await page . waitForTimeout ( 2000 ) ; // Extra buffer for Blazor hydration
4143
42- // Check page title
43- await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Trial Balance' , { timeout : 30000 } ) ;
44+ // Check page title (may take time to load)
45+ await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Trial Balance' , { timeout : 60000 } ) ;
4446
4547 // Company selector should be visible (may take time to load)
46- await expect ( page . locator ( 'select#company-select' ) ) . toBeVisible ( { timeout : 30000 } ) ;
48+ await expect ( page . locator ( 'select#company-select' ) ) . toBeVisible ( { timeout : 60000 } ) ;
4749
4850 // Select a company if available
4951 const companySelect = page . locator ( 'select#company-select' ) ;
@@ -88,12 +90,13 @@ test.describe('Ledger API Integration', () => {
8890 test ( 'profit and loss page has company selector and date range' , async ( { page } ) => {
8991 await page . goto ( '/accounting/reports/pl' ) ;
9092 await page . waitForLoadState ( 'networkidle' ) ;
93+ await page . waitForTimeout ( 2000 ) ; // Extra buffer for Blazor hydration
9194
92- // Check page title
93- await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Profit & Loss' , { timeout : 30000 } ) ;
95+ // Check page title (may take time to load)
96+ await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Profit & Loss' , { timeout : 60000 } ) ;
9497
9598 // Company selector should be visible (may take time to load)
96- await expect ( page . locator ( 'select' ) ) . toBeVisible ( { timeout : 30000 } ) ;
99+ await expect ( page . locator ( 'select' ) ) . toBeVisible ( { timeout : 60000 } ) ;
97100
98101 // Select a company if available
99102 const companySelect = page . locator ( 'select' ) . first ( ) ;
@@ -139,12 +142,13 @@ test.describe('Ledger API Integration', () => {
139142 test ( 'VAT summary page shows MTD boxes' , async ( { page } ) => {
140143 await page . goto ( '/accounting/vat-summary' ) ;
141144 await page . waitForLoadState ( 'networkidle' ) ;
145+ await page . waitForTimeout ( 2000 ) ; // Extra buffer for Blazor hydration
142146
143- // Check page title
144- await expect ( page . locator ( 'h3' ) ) . toContainText ( 'VAT Summary' , { timeout : 30000 } ) ;
147+ // Check page title (may take time to load)
148+ await expect ( page . locator ( 'h3' ) ) . toContainText ( 'VAT Summary' , { timeout : 60000 } ) ;
145149
146150 // Company selector should be visible (may take time to load)
147- await expect ( page . locator ( 'select#company-select' ) ) . toBeVisible ( { timeout : 30000 } ) ;
151+ await expect ( page . locator ( 'select#company-select' ) ) . toBeVisible ( { timeout : 60000 } ) ;
148152
149153 const companySelect = page . locator ( 'select#company-select' ) ;
150154 const optionCount = await companySelect . locator ( 'option' ) . count ( ) ;
@@ -196,12 +200,13 @@ test.describe('Ledger API Integration', () => {
196200 test ( 'ledger invoices page has create modal' , async ( { page } ) => {
197201 await page . goto ( '/accounting/invoices' ) ;
198202 await page . waitForLoadState ( 'networkidle' ) ;
203+ await page . waitForTimeout ( 2000 ) ; // Extra buffer for Blazor hydration
199204
200205 // Check page title
201- await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Ledger Invoices' , { timeout : 30000 } ) ;
206+ await expect ( page . locator ( 'h3' ) ) . toContainText ( 'Ledger Invoices' , { timeout : 60000 } ) ;
202207
203208 const companySelect = page . locator ( 'select#company-select' ) ;
204- await expect ( companySelect ) . toBeVisible ( { timeout : 30000 } ) ;
209+ await expect ( companySelect ) . toBeVisible ( { timeout : 60000 } ) ;
205210 const optionCount = await companySelect . locator ( 'option' ) . count ( ) ;
206211
207212 if ( optionCount > 1 ) {
@@ -291,10 +296,11 @@ test.describe('Ledger API Integration', () => {
291296 for ( const url of pages ) {
292297 await page . goto ( url ) ;
293298 await page . waitForLoadState ( 'networkidle' ) ;
299+ await page . waitForTimeout ( 2000 ) ; // Extra buffer for Blazor hydration
294300
295301 // Company selector should always be visible (may take time to load)
296302 const companySelect = page . locator ( 'select#company-select, select' ) ;
297- await expect ( companySelect . first ( ) ) . toBeVisible ( { timeout : 30000 } ) ;
303+ await expect ( companySelect . first ( ) ) . toBeVisible ( { timeout : 60000 } ) ;
298304
299305 // Should have at least the "Select Company..." option
300306 const options = companySelect . first ( ) . locator ( 'option' ) ;
0 commit comments