From d947d8c9755e1ac7f68b60bbd869eabb88e00709 Mon Sep 17 00:00:00 2001 From: Pranav Joglekar Date: Tue, 12 Oct 2021 00:51:30 +0530 Subject: [PATCH] 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 --- .../check-radio-buttons-and-checkboxes-by-default.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.md b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.md index 4767266d49..0e9f5fe7e6 100644 --- a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.md +++ b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/check-radio-buttons-and-checkboxes-by-default.md @@ -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--