Как протестировать (unit-тестирования) блок catch на vue в методе компонента с помощью Jest?
loginSystem() {
const role = this.role
let username = this.login;
let password = this.password;
this.$store.dispatch('loginSystem', {username, password, role}).then(() => this.$router.push({name: this.role === 'projects'})).catch(
(error) => {
if (error.code === 5) {
this.showLoginError = true
}
if (error.response.status === 401) {
this.showLoginError = true
}
if (error.response.status === 403) {
this.showLoginError = true
}
}
);
}