mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): add generate-btn click to sort-btn test (#62252)
This commit is contained in:
+2
@@ -286,11 +286,13 @@ try {
|
||||
When you click the `#sort-btn`, you should make use of the `highlightCurrentEls` function to highlight the elements being compared in each step.
|
||||
|
||||
```js
|
||||
const genBtn = document.querySelector("#generate-btn");
|
||||
const sortBtn = document.querySelector("#sort-btn");
|
||||
let flag = false;
|
||||
const temp = highlightCurrentEls;
|
||||
highlightCurrentEls = () => flag = true;
|
||||
try {
|
||||
genBtn.dispatchEvent(new Event("click"));
|
||||
sortBtn.dispatchEvent(new Event("click"));
|
||||
assert.isTrue(flag);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user