Created
January 16, 2022 20:57
-
-
Save screamingworld/2ff1e99bdc0e6a853cad35dd9b8a38f9 to your computer and use it in GitHub Desktop.
Base class for testing js/ts event listener
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestSetting { | |
protected element:HTMLElement | null; | |
constructor () { | |
let div = document.createElement('div'); | |
div.setAttribute('id', 'elementToClick'); | |
document.body.appendChild(div); | |
this.element = document.getElementById('elementToClick'); | |
} | |
public simulateOnClick(): void { | |
if (this.element == null) { | |
return; | |
} | |
this.element.click(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment