diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-10-17 10:13:26 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-10-17 19:18:17 +0300 |
commit | f666026d71ebefd70219d5078b1f0c83fa01f84d (patch) | |
tree | ce43feb99c12c21dd266d25de24b1768bac1d459 /spec/javascripts/projects | |
parent | 5a6fffcffca3dc8e4f52c90d3d18eaefd9e48aef (diff) |
Prettify all spec files
Diffstat (limited to 'spec/javascripts/projects')
4 files changed, 70 insertions, 40 deletions
diff --git a/spec/javascripts/projects/gke_cluster_dropdowns/components/gke_machine_type_dropdown_spec.js b/spec/javascripts/projects/gke_cluster_dropdowns/components/gke_machine_type_dropdown_spec.js index 345a7c551d1..fdecb823cd2 100644 --- a/spec/javascripts/projects/gke_cluster_dropdowns/components/gke_machine_type_dropdown_spec.js +++ b/spec/javascripts/projects/gke_cluster_dropdowns/components/gke_machine_type_dropdown_spec.js @@ -90,14 +90,20 @@ describe('GkeMachineTypeDropdown', () => { expect(vm.$el.querySelector('input').value).toBe(''); vm.$store.commit(SET_MACHINE_TYPES, gapiMachineTypesResponseMock.items); - return vm.$nextTick().then(() => { - vm.$el.querySelector('.dropdown-content button').click(); - - return vm.$nextTick().then(() => { - expect(vm.$el.querySelector('input').value).toBe(selectedMachineTypeMock); - done(); - }).catch(done.fail); - }).catch(done.fail); + return vm + .$nextTick() + .then(() => { + vm.$el.querySelector('.dropdown-content button').click(); + + return vm + .$nextTick() + .then(() => { + expect(vm.$el.querySelector('input').value).toBe(selectedMachineTypeMock); + done(); + }) + .catch(done.fail); + }) + .catch(done.fail); }); }); }); diff --git a/spec/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown_spec.js b/spec/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown_spec.js index 0cae29c2613..030662b4d90 100644 --- a/spec/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown_spec.js +++ b/spec/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown_spec.js @@ -53,41 +53,56 @@ describe('GkeProjectIdDropdown', () => { }); it('returns default toggle text', done => - vm.$nextTick().then(() => { - vm.setItem(emptyProjectMock); + vm + .$nextTick() + .then(() => { + vm.setItem(emptyProjectMock); - expect(vm.toggleText).toBe(LABELS.DEFAULT); - done(); - }).catch(done.fail)); + expect(vm.toggleText).toBe(LABELS.DEFAULT); + done(); + }) + .catch(done.fail)); it('returns project name if project selected', done => - vm.$nextTick().then(() => { - expect(vm.toggleText).toBe(selectedProjectMock.name); - done(); - }).catch(done.fail)); + vm + .$nextTick() + .then(() => { + expect(vm.toggleText).toBe(selectedProjectMock.name); + done(); + }) + .catch(done.fail)); it('returns empty toggle text', done => - vm.$nextTick().then(() => { - vm.$store.commit(SET_PROJECTS, null); - vm.setItem(emptyProjectMock); + vm + .$nextTick() + .then(() => { + vm.$store.commit(SET_PROJECTS, null); + vm.setItem(emptyProjectMock); - expect(vm.toggleText).toBe(LABELS.EMPTY); - done(); - }).catch(done.fail)); + expect(vm.toggleText).toBe(LABELS.EMPTY); + done(); + }) + .catch(done.fail)); }); describe('selectItem', () => { it('reflects new value when dropdown item is clicked', done => { expect(vm.$el.querySelector('input').value).toBe(''); - return vm.$nextTick().then(() => { - vm.$el.querySelector('.dropdown-content button').click(); - - return vm.$nextTick().then(() => { - expect(vm.$el.querySelector('input').value).toBe(selectedProjectMock.projectId); - done(); - }).catch(done.fail); - }).catch(done.fail); + return vm + .$nextTick() + .then(() => { + vm.$el.querySelector('.dropdown-content button').click(); + + return vm + .$nextTick() + .then(() => { + expect(vm.$el.querySelector('input').value).toBe(selectedProjectMock.projectId); + done(); + }) + .catch(done.fail); + }) + .catch(done.fail); }); }); }); diff --git a/spec/javascripts/projects/gke_cluster_dropdowns/components/gke_zone_dropdown_spec.js b/spec/javascripts/projects/gke_cluster_dropdowns/components/gke_zone_dropdown_spec.js index a07e00845cf..95186e19ca1 100644 --- a/spec/javascripts/projects/gke_cluster_dropdowns/components/gke_zone_dropdown_spec.js +++ b/spec/javascripts/projects/gke_cluster_dropdowns/components/gke_zone_dropdown_spec.js @@ -75,14 +75,20 @@ describe('GkeZoneDropdown', () => { expect(vm.$el.querySelector('input').value).toBe(''); vm.$store.commit(SET_ZONES, gapiZonesResponseMock.items); - return vm.$nextTick().then(() => { - vm.$el.querySelector('.dropdown-content button').click(); - - return vm.$nextTick().then(() => { - expect(vm.$el.querySelector('input').value).toBe(selectedZoneMock); - done(); - }).catch(done.fail); - }).catch(done.fail); + return vm + .$nextTick() + .then(() => { + vm.$el.querySelector('.dropdown-content button').click(); + + return vm + .$nextTick() + .then(() => { + expect(vm.$el.querySelector('input').value).toBe(selectedZoneMock); + done(); + }) + .catch(done.fail); + }) + .catch(done.fail); }); }); }); diff --git a/spec/javascripts/projects/project_new_spec.js b/spec/javascripts/projects/project_new_spec.js index dace834a3c8..b61e0ac872f 100644 --- a/spec/javascripts/projects/project_new_spec.js +++ b/spec/javascripts/projects/project_new_spec.js @@ -27,7 +27,10 @@ describe('New Project', () => { beforeEach(() => { projectNew.bindEvents(); - $projectPath.val('').keyup().val(dummyImportUrl); + $projectPath + .val('') + .keyup() + .val(dummyImportUrl); }); it('does not change project path for disabled $projectImportUrl', () => { |