Skip to content

Commit

Permalink
Fix setup scripts which open the listbox and/or move focus to specifi…
Browse files Browse the repository at this point in the history
…c options
  • Loading branch information
jscholes committed Nov 22, 2020
1 parent af45067 commit f4d80c0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
5 changes: 1 addition & 4 deletions tests/combobox-select-only/data/js/openListbox.js
Original file line number Diff line number Diff line change
@@ -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);
4 changes: 2 additions & 2 deletions tests/combobox-select-only/data/js/openListboxToApple.js
Original file line number Diff line number Diff line change
@@ -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);
4 changes: 2 additions & 2 deletions tests/combobox-select-only/data/js/openListboxToGuava.js
Original file line number Diff line number Diff line change
@@ -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);
Original file line number Diff line number Diff line change
@@ -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);
2 changes: 1 addition & 1 deletion tests/combobox-select-only/reference/js/select-only.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

0 comments on commit f4d80c0

Please sign in to comment.