check for submitButton

fixes issue with tests when only the component is being tested
This commit is contained in:
Dennis Tang 2018-05-09 14:30:14 +02:00
parent cf65abd840
commit 84452bfaca
1 changed files with 5 additions and 1 deletions

View File

@ -109,7 +109,11 @@ export default {
},
enableSubmit() {
if (this.hasProject && this.hasZone && this.hasMachineType) {
document.querySelector('.js-gke-cluster-creation-submit').removeAttribute('disabled');
const submitButtonEl = document.querySelector('.js-gke-cluster-creation-submit');
if (submitButtonEl) {
submitButtonEl.removeAttribute('disabled');
}
}
},
},