diff --git a/tests/combobox-select-only/data/js/openListbox.js b/tests/combobox-select-only/data/js/openListbox.js index ceade1ff4..e465cba49 100644 --- a/tests/combobox-select-only/data/js/openListbox.js +++ b/tests/combobox-select-only/data/js/openListbox.js @@ -1,6 +1,3 @@ // sets focus on and expands the Combobox testPageDocument.querySelector('[role="combobox"]').focus(); -window.setTimeout(onSelectReady, () => { - console.log('Opening listbox'); - window.selectController.updateMenuState(true) -}, 500); +testPageDocument.defaultView.selectController.updateMenuState(true); diff --git a/tests/combobox-select-only/data/js/openListboxToApple.js b/tests/combobox-select-only/data/js/openListboxToApple.js index 1ddd96981..437fa5d7c 100644 --- a/tests/combobox-select-only/data/js/openListboxToApple.js +++ b/tests/combobox-select-only/data/js/openListboxToApple.js @@ -1,4 +1,4 @@ // sets focus on and expands the Combobox, and sets the focused option to 'Apple' testPageDocument.querySelector('[role="combobox"]').focus(); -window.selectController.updateMenuState(true); -window.selectController.onOptionChange(1); +testPageDocument.defaultView.selectController.updateMenuState(true); +testPageDocument.defaultView.selectController.onOptionChange(1); diff --git a/tests/combobox-select-only/data/js/openListboxToGuava.js b/tests/combobox-select-only/data/js/openListboxToGuava.js index 650cdb6e8..a83fca9bd 100644 --- a/tests/combobox-select-only/data/js/openListboxToGuava.js +++ b/tests/combobox-select-only/data/js/openListboxToGuava.js @@ -1,4 +1,4 @@ // sets focus on and expands the Combobox, and sets the focused option to 'Guave' testPageDocument.querySelector('[role="combobox"]').focus(); -window.selectController.updateMenuState(true); -window.selectController.onOptionChange(11); +testPageDocument.defaultView.selectController.updateMenuState(true); +testPageDocument.defaultView.selectController.onOptionChange(11); diff --git a/tests/combobox-select-only/data/js/openListboxToHuckleberry.js b/tests/combobox-select-only/data/js/openListboxToHuckleberry.js index 98e88291e..3c85a7755 100644 --- a/tests/combobox-select-only/data/js/openListboxToHuckleberry.js +++ b/tests/combobox-select-only/data/js/openListboxToHuckleberry.js @@ -1,4 +1,4 @@ // sets focus on and expands the Combobox, and sets the focused option to 'Huckleberry' testPageDocument.querySelector('[role="combobox"]').focus(); -window.selectController.updateMenuState(true); -window.selectController.onOptionChange(2); +testPageDocument.defaultView.selectController.updateMenuState(true); +testPageDocument.defaultView.selectController.onOptionChange(12); diff --git a/tests/combobox-select-only/reference/js/select-only.js b/tests/combobox-select-only/reference/js/select-only.js index 3158821ab..2398e1b9d 100644 --- a/tests/combobox-select-only/reference/js/select-only.js +++ b/tests/combobox-select-only/reference/js/select-only.js @@ -386,5 +386,5 @@ window.addEventListener('load', function () { 'Huckleberry', ]; const selectEl = document.querySelector('.js-select'); - window.selectController = new Select(selectEl, options); + document.defaultView.selectController = new Select(selectEl, options); });