Skip to content

Commit

Permalink
fix(mock-doc): add missing methods to the element mock (#3480)
Browse files Browse the repository at this point in the history
add the following method stubs to `MockElement`:
- animate
- requestFullscreen
- scrollBy
- scrollTo
- scrollIntoView

all functions accept zero arguments and return nothing (`undefined`).
if in the future that premise needs to be revisited, the team will update
the function signatures at their discretion
  • Loading branch information
erwinheitzman committed Jul 20, 2022
1 parent c4d894f commit 835e00f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/mock-doc/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,9 @@ export class MockElement extends MockNode {
this.setAttributeNS(null, 'title', value);
}

animate() {
/**/
}
onanimationstart() {
/**/
}
Expand Down Expand Up @@ -979,6 +982,18 @@ export class MockElement extends MockNode {
onwheel() {
/**/
}
requestFullscreen() {
/**/
}
scrollBy() {
/**/
}
scrollTo() {
/**/
}
scrollIntoView() {
/**/
}

override toString(opts?: SerializeNodeToHtmlOptions) {
return serializeNodeToHtml(this as any, opts);
Expand Down

0 comments on commit 835e00f

Please sign in to comment.