Editor: the view switch test picks View menu rows with the pointer
TestTidyViewSwitch opened nothing and called .click() on the rows; it now opens the View menu by clicking its title and clicks each row where it is drawn, as a person would.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+10
−2
internal/slidestest/browser_editor_tidy_test.go+10 −2
diff --git a/internal/slidestest/browser_editor_tidy_test.go b/internal/slidestest/browser_editor_tidy_test.go| index b0b9bf1..46f8741 100644 |
| --- a/internal/slidestest/browser_editor_tidy_test.go |
| +++ b/internal/slidestest/browser_editor_tidy_test.go |
| @@ -438,9 +438,17 @@ func TestTidyViewSwitch(t *testing.T) { |
| te.rig.Run(waitFor(`document.querySelector('[slides-stage-pane]').dataset.view === 'phone'`)) |
| check("ArrowRight from the first icon", "phone") |
| - // The View menu's rows do the same. |
| + // The View menu's rows do the same, chosen as a person would: the |
| + // menu opened with a click on its title, the row clicked where it |
| + // is drawn. |
| for _, v := range []string{"both", "desktop", "phone"} { |
| - te.rig.Run(chromedp.Evaluate(`document.querySelector('[data-view-choice="`+v+`"]').click()`, nil)) |
| + var open bool |
| + te.rig.Run(chromedp.Evaluate(`document.querySelector('[slides-menu="view"]').open`, &open)) |
| + if !open { |
| + center(`[slides-menu="view"] > summary`) |
| + te.rig.Run(waitFor(`document.querySelector('[slides-menu="view"]').open`)) |
| + } |
| + center(`[data-view-choice="` + v + `"]`) |
| te.rig.Run(waitFor(fmt.Sprintf(`document.querySelector('[slides-stage-pane]').dataset.view === %q`, v))) |
| check("the View menu's "+v+" row", v) |
| } |