mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-19 21:09:51 +08:00
edit test to allow for flexible attribute placement and accompanying … (#53397)
This commit is contained in:
parent
d14fd2af26
commit
89773cd9e4
@ -13,16 +13,16 @@ To enable editing and deleting for each task, add an `onclick` attribute to both
|
||||
|
||||
# --hints--
|
||||
|
||||
You should add `onclick="editTask(this)"` as the first attribute of the edit button.
|
||||
You should add `onclick="editTask(this)"` to your edit button.
|
||||
|
||||
```js
|
||||
assert.match(code, /<button\s*onclick\s*=\s*('|")editTask\(\s*this\s*\)\1\s*type\s*=\s*('|")button\2\s*class\s*=\s*('|")btn\3\s*>Edit<\/button>/)
|
||||
assert.match(code, /<button(?=[^>]*onclick\s*=\s*("|')editTask\(this\)\1)[^>]*>Edit<\/button>/);
|
||||
```
|
||||
|
||||
You should add `onclick="deleteTask(this)"` as the first attribute of the delete button.
|
||||
You should add `onclick="deleteTask(this)"` to your delete button.
|
||||
|
||||
```js
|
||||
assert.match(code, /<button\s*onclick\s*=\s*('|")deleteTask\(\s*this\s*\)\1\s*type\s*=\s*('|")button\2\s*class\s*=\s*('|")btn\3>Delete<\/button>/)
|
||||
assert.match(code, /<button(?=[^>]*onclick\s*=\s*("|')deleteTask\(this\)\1)[^>]*>Delete<\/button>/);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
Loading…
Reference in New Issue
Block a user