i have a template with the following
<button type="button" id="alogin" class="btn btn-primary btn-raised btn-block btn-lg" @click="login()">Sign In</button>
the login function is quite long but composed of
login() {
this.error = 'none';
this.error_message = null;
const self = this;
authentication.login(config, self.id_number, self.password, (err, result) => {
if (err) {
} else {
self.startSession();
}
});
}
ive try testing clicking the login button like after setting
it('tries to login', () => {
LoginComponent.id_number = '293io090';
LoginComponent.password = 'password';
expect(LoginComponent.$el.querySelector('#alogin').click()).to.equal(true);
but end up getting undefined. ive used vuejs test utils to find('#alogin') but the result is still the same. getting stuck