edit test to allow for flexible attribute placement and accompanying … (#53397)

This commit is contained in:
Jr Cenina 2024-01-30 02:31:27 -08:00 committed by GitHub
parent d14fd2af26
commit 89773cd9e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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--