mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix: dispatch input event for textarea (#60107)
This commit is contained in:
+4
@@ -219,6 +219,7 @@ Once the value of `#complaint-description` is changed to a valid value, you shou
|
||||
```js
|
||||
const field = document.getElementById("complaint-description");
|
||||
field.value = "A sentence with at least twenty characters"
|
||||
field.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
field.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
assert.equal(field.style.borderColor, "green");
|
||||
```
|
||||
@@ -228,6 +229,7 @@ Once the value of `#complaint-description` is changed to an invalid value, you s
|
||||
```js
|
||||
const field = document.getElementById("complaint-description");
|
||||
field.value = "Not enough chars"
|
||||
field.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
field.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
assert.equal(field.style.borderColor, "red");
|
||||
```
|
||||
@@ -293,6 +295,7 @@ Once the value of `#solution-description` is changed to a valid value, you shoul
|
||||
```js
|
||||
const field = document.getElementById("solution-description");
|
||||
field.value = "A sentence with at least twenty characters"
|
||||
field.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
field.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
assert.equal(field.style.borderColor, "green");
|
||||
```
|
||||
@@ -302,6 +305,7 @@ Once the value of `#solution-description` is changed to an invalid value, you sh
|
||||
```js
|
||||
const field = document.getElementById("solution-description");
|
||||
field.value = "Not enough chars"
|
||||
field.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
field.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
assert.equal(field.style.borderColor, "red");
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user