mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-01 17:03:30 -05:00
fix(curriculum): make tests independent of previous tests (Customer Complaint Form) (#60348)
Co-authored-by: Ilenia M <nethleen@gmail.com>
This commit is contained in:
@@ -214,9 +214,10 @@ document.getElementById("complaint-description").value = "Less than 20 chars";
|
||||
assert.isFalse(validateForm()["complaint-description"]);
|
||||
```
|
||||
|
||||
Once the value of `#complaint-description` is changed to a valid value, you should set its border color to `green`.
|
||||
When `#other-complaint` is checked and the value of `#complaint-description` is changed to a valid value, you should set its border color to `green`.
|
||||
|
||||
```js
|
||||
document.getElementById("other-complaint").checked = true;
|
||||
const field = document.getElementById("complaint-description");
|
||||
field.value = "A sentence with at least twenty characters"
|
||||
field.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
@@ -224,9 +225,10 @@ field.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
assert.equal(field.style.borderColor, "green");
|
||||
```
|
||||
|
||||
Once the value of `#complaint-description` is changed to an invalid value, you should set its border color to `red`.
|
||||
When `#other-complaint` is checked and the value of `#complaint-description` is changed to an invalid value, you should set its border color to `red`.
|
||||
|
||||
```js
|
||||
document.getElementById("other-complaint").checked = true;
|
||||
const field = document.getElementById("complaint-description");
|
||||
field.value = "Not enough chars"
|
||||
field.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
@@ -290,9 +292,10 @@ document.getElementById("solution-description").value = "Less than 20 chars";
|
||||
assert.isFalse(validateForm()["solution-description"]);
|
||||
```
|
||||
|
||||
Once the value of `#solution-description` is changed to a valid value, you should set its border color to `green`.
|
||||
When `#other-solution` is checked and the value of `#solution-description` is changed to a valid value, you should set its border color to `green`.
|
||||
|
||||
```js
|
||||
document.getElementById("other-solution").checked = true;
|
||||
const field = document.getElementById("solution-description");
|
||||
field.value = "A sentence with at least twenty characters"
|
||||
field.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
@@ -300,9 +303,10 @@ field.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
assert.equal(field.style.borderColor, "green");
|
||||
```
|
||||
|
||||
Once the value of `#solution-description` is changed to an invalid value, you should set its border color to `red`.
|
||||
When `#other-solution` is checked and the value of `#solution-description` is changed to an invalid value, you should set its border color to `red`.
|
||||
|
||||
```js
|
||||
document.getElementById("other-solution").checked = true;
|
||||
const field = document.getElementById("solution-description");
|
||||
field.value = "Not enough chars"
|
||||
field.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
|
||||
Reference in New Issue
Block a user