Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(curriculum): update test todo app step 6 #54650

Closed
wants to merge 1 commit into from

Conversation

Supravisor
Copy link
Contributor

Checklist:

Closes #54625

Pass for arrow function syntax, without curly braces
image

Pass for arrow function syntax, with curly braces
image

Pass for regular function
image

@github-actions github-actions bot added the scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. label May 4, 2024
@jdwilkin4 jdwilkin4 added status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. new javascript course These are for issues dealing with the new JS curriculum labels May 6, 2024
@@ -40,7 +40,7 @@ assert.match(code, /openTaskFormBtn\.addEventListener\(\s*('|"|`)click\1/)
Your event listener's callback function should use the `classList.toggle()` method to toggle the `hidden` class on the `taskForm` element. Refer back to the example provided in the description.

```js
assert.match(code, /openTaskFormBtn\.addEventListener\(\s*('|"|`)click\1\s*,\s*(?:\(\s*\)\s*=>\s*taskForm\s*\.classList\s*\.\s*toggle\s*\(\s*('|"|`)hidden\2\s*\)\s*\)|\s*function\s*\(\s*\)\s*\s*{\s*taskForm\s*\.classList\s*\.\s*toggle\s*\(\s*('|"|`)hidden\3\s*\)\s*}\s*\)\s*;)/)
assert.match(code, /openTaskFormBtn\.addEventListener\(\s*('|"|`)click\1\s*,\s*(?:\(\s*\)\s*=>\s*taskForm\s*\.classList\s*\.\s*toggle\s*\(\s*('|"|`)hidden\2\s*\)\s*\)|\s*function\s*\(\s*\)\s*\s*{\s*taskForm\s*\.classList\s*\.\s*toggle\s*\(\s*('|"|`)hidden\3\s*\)\s*}\s*\)\s*;|\s*\(\s*\)\s*=\s*>\s*\{\s*taskForm\s*\.classList\s*\.\s*toggle\s*\(\s*('|"|`)hidden\4\s*\)\s*\}\s*\)\s*;)/)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's actually remove the regex altogether and simulate the click event instead.
something like this should work.
I suggest testing it on your end too but this should be easier to manage

Suggested change
assert.match(code, /openTaskFormBtn\.addEventListener\(\s*('|"|`)click\1\s*,\s*(?:\(\s*\)\s*=>\s*taskForm\s*\.classList\s*\.\s*toggle\s*\(\s*('|"|`)hidden\2\s*\)\s*\)|\s*function\s*\(\s*\)\s*\s*{\s*taskForm\s*\.classList\s*\.\s*toggle\s*\(\s*('|"|`)hidden\3\s*\)\s*}\s*\)\s*;|\s*\(\s*\)\s*=\s*>\s*\{\s*taskForm\s*\.classList\s*\.\s*toggle\s*\(\s*('|"|`)hidden\4\s*\)\s*\}\s*\)\s*;)/)
assert(taskForm.classList.contains('hidden'));
openTaskFormBtn.click();
assert(!taskForm.classList.contains('hidden'));

@jdwilkin4 jdwilkin4 added status: waiting update To be applied to PR if a maintainer/reviewer has left a feedback and follow up is needed from OP and removed status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. labels May 7, 2024
@jdwilkin4
Copy link
Contributor

It looks like another PR was merged in that address this issue.
#54626

So as result, we are going to close yours

@jdwilkin4 jdwilkin4 closed this May 7, 2024
@Supravisor Supravisor deleted the todo06 branch May 8, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new javascript course These are for issues dealing with the new JS curriculum scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. status: waiting update To be applied to PR if a maintainer/reviewer has left a feedback and follow up is needed from OP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix tests for step 6 of todo project
2 participants