Add comments to JS and improve selector in test

After talking with the reviewer, it was decided
that:
1. the JS could do with some comments to explain
   its structure and what various functions do
   better
2. some CSS selectors in the tests don't need to
   be as complex and simplifying them makes the
   test easier to read
This commit is contained in:
Tom Byers
2021-01-20 11:23:01 +00:00
parent 9651da1292
commit ba6b4682c3
2 changed files with 21 additions and 12 deletions

View File

@@ -304,7 +304,7 @@ describe('RadioSelect', () => {
test("focus the selected option", () => {
selectedOption = document.querySelector('.radio-select__column:nth-child(2) input[checked=checked]');
selectedOption = document.querySelector('.radio-select__column input[checked=checked]');
expect(document.activeElement).toBe(selectedOption);
@@ -349,7 +349,7 @@ describe('RadioSelect', () => {
test("focus the selected option", () => {
selectedOption = document.querySelector('.radio-select__column:nth-child(2) input[checked=checked]');
selectedOption = document.querySelector('.radio-select__column input[checked=checked]');
expect(document.activeElement).toBe(selectedOption);
@@ -408,7 +408,7 @@ describe('RadioSelect', () => {
test("focus the selected option", () => {
selectedOption = document.querySelector('.radio-select__column:nth-child(2) input[checked=checked]');
selectedOption = document.querySelector('.radio-select__column input[checked=checked]');
expect(document.activeElement).toBe(selectedOption);