@@ -388,6 +388,14 @@ test('simple calculation', async ({ page }) => {
388388 await go ( page , 'formula-simple--simple-calculation' ) ;
389389 const largeEditor = page . locator ( '.gs-formula-bar textarea' ) ;
390390
391+ // Verify A1 formula bar shows raw formula (formulaEnabled: false active)
392+ await page . locator ( "[data-address='A1']" ) . click ( ) ;
393+ expect ( await largeEditor . inputValue ( ) ) . toBe ( '=100 + 5' ) ;
394+
395+ // Verify that A-column cell containing an address reference is NOT converted to an internal ID
396+ // A2 has value "=B1 - 60" with formulaEnabled:false — it must render the literal string, not e.g. "=#3- 60"
397+ expect ( await page . locator ( '[data-address="A2"] .gs-cell-rendered' ) . textContent ( ) ) . toBe ( '=B1 - 60' ) ;
398+
391399 // Column A: formulaEnabled: false — formula is displayed as raw text, not evaluated
392400 // Column B: formula is evaluated normally
393401
@@ -451,17 +459,13 @@ test('simple calculation', async ({ page }) => {
451459 expect ( await page . locator ( '[data-address="B34"] .gs-cell-rendered' ) . textContent ( ) ) . toBe ( '123' ) ;
452460 expect ( await page . locator ( '[data-address="B35"] .gs-cell-rendered' ) . textContent ( ) ) . toBe ( '0123' ) ;
453461
454- // Verify that none of the B-column results are #VALUE!
455- for ( let row = 1 ; row <= 35 ; row ++ ) {
456- const text = await page . locator ( `[data-address="B${ row } "] .gs-cell-rendered` ) . textContent ( ) ;
457- expect ( text ) . not . toBe ( '#VALUE!' ) ;
458- }
459-
460- // Verify A1 formula bar shows raw formula (formulaEnabled: false active)
461- await page . locator ( "[data-address='A1']" ) . click ( ) ;
462- expect ( await largeEditor . inputValue ( ) ) . toBe ( '=100 + 5' ) ;
463-
464- // Verify that A-column cell containing an address reference is NOT converted to an internal ID
465- // A2 has value "=B1 - 60" with formulaEnabled:false — it must render the literal string, not e.g. "=#3- 60"
466- expect ( await page . locator ( '[data-address="A2"] .gs-cell-rendered' ) . textContent ( ) ) . toBe ( '=B1 - 60' ) ;
462+ // Percentage handling — scroll into view first (virtualized rows may not be rendered)
463+ await page . locator ( '[data-address="A36"]' ) . scrollIntoViewIfNeeded ( ) ;
464+ expect ( await page . locator ( '[data-address="B37"] .gs-cell-rendered' ) . textContent ( ) ) . toBe ( '5.05' ) ;
465+ expect ( await page . locator ( '[data-address="B38"] .gs-cell-rendered' ) . textContent ( ) ) . toBe ( '10' ) ;
466+ expect ( await page . locator ( '[data-address="B39"] .gs-cell-rendered' ) . textContent ( ) ) . toBe ( '0.5' ) ;
467+ expect ( await page . locator ( '[data-address="B40"] .gs-cell-rendered' ) . textContent ( ) ) . toBe ( '1.5' ) ;
468+ expect ( await page . locator ( '[data-address="B41"] .gs-cell-rendered' ) . textContent ( ) ) . toBe ( '50%' ) ;
469+ expect ( await page . locator ( '[data-address="B42"] .gs-cell-rendered' ) . textContent ( ) ) . toBe ( '5.5' ) ;
470+ expect ( await page . locator ( '[data-address="B43"] .gs-cell-rendered' ) . textContent ( ) ) . toBe ( '23.43' ) ;
467471} ) ;
0 commit comments