Fix use of querySelector in radioSelect tests

This commit is contained in:
Tom Byers
2020-07-16 16:03:13 +01:00
committed by Chris Hill-Scott
parent 83156bd16e
commit 636cb6825b

View File

@@ -114,7 +114,7 @@ describe('RadioSelect', () => {
</div> </div>
</fieldset>`; </fieldset>`;
originalOptionsForAllCategories = Array.from(document.querySelector('.radio-select__column:nth-child(2) .multiple-choice')) originalOptionsForAllCategories = Array.from(document.querySelectorAll('.radio-select__column:nth-child(2) .multiple-choice'))
.map(option => getDataFromOption(option)); .map(option => getDataFromOption(option));
}); });
@@ -173,7 +173,7 @@ describe('RadioSelect', () => {
test("show the options for it, with the right label and value", () => { test("show the options for it, with the right label and value", () => {
// check options this reveals against those originally in the page for this category // check options this reveals against those originally in the page for this category
const options = document.querySelector('.radio-select__column:nth-child(2) .multiple-choice'); const options = document.querySelectorAll('.radio-select__column:nth-child(2) .multiple-choice');
const optionsThatMatchOriginals = Array.from(options).filter((option, idx) => { const optionsThatMatchOriginals = Array.from(options).filter((option, idx) => {
const optionData = getDataFromOption(option); const optionData = getDataFromOption(option);