From 84452bfacaac63df5c431084c596ff254216b08e Mon Sep 17 00:00:00 2001 From: Dennis Tang Date: Wed, 9 May 2018 14:30:14 +0200 Subject: check for submitButton fixes issue with tests when only the component is being tested --- .../gke_cluster_dropdowns/components/gke_machine_type_dropdown.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/assets') diff --git a/app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_machine_type_dropdown.vue b/app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_machine_type_dropdown.vue index 1b9bc5d2cff..3af7cd07237 100644 --- a/app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_machine_type_dropdown.vue +++ b/app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_machine_type_dropdown.vue @@ -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'); + } } }, }, -- cgit v1.2.1