fix: add test to ensure the innerText of labels doesn't change (#43803)

For the check-radio-buttons-and-checkboxes-by-default exercise,
campers are able to pass the exercise if the checked attribute is
written in an incorrect syntax. This PR checks the innerText of the
elements which are being added the 'checked' attribute and ensures that
their value doesn't change.
Fixes #43750
pull/43815/head
Pranav Joglekar 2021-10-12 00:51:30 +05:30 committed by GitHub
parent 20fd622b67
commit d947d8c975
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -35,6 +35,18 @@ Your first checkbox on your form should be checked by default.
assert($('input[type="checkbox"]').prop('checked'));
```
You should not change the inner text of the `Indoor` label.
```js
assert.equal(document.querySelector('label[for="indoor"]')?.innerText?.trim(), 'Indoor');
```
You should not change the inner text of the `Loving` label.
```js
assert.equal(document.querySelector('label[for="loving"]')?.innerText?.trim(), 'Loving');
```
# --seed--
## --seed-contents--