Add JS tests to verify school and district dropdowns.

This commit is contained in:
rebuilt 2021-10-08 22:56:37 +02:00
parent 2d4ba042f9
commit 6320d5633f
12 changed files with 219 additions and 74 deletions

View file

@ -1,9 +1,12 @@
document.addEventListener("DOMContentLoaded", function() {
document.querySelector('#select-school').addEventListener('change', (event) => {
window.location = event.target.value;
});
document.addEventListener("turbolinks:load", function() {
const schoolDropdown = document.querySelector('#select-school');
if (schoolDropdown) {
document.querySelector('#select-school').addEventListener('change', (event) => {
window.location = event.target.value;
});
document.querySelector('#select-district').addEventListener('change', (event) => {
window.location = event.target.value;
});
document.querySelector('#select-district').addEventListener('change', (event) => {
window.location = event.target.value;
});
}
});