From c63afd30ed2c5a342c0c4d2347c948f622a66f00 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Wed, 7 Mar 2018 19:45:46 +0000 Subject: Fix broken tests --- spec/javascripts/pipelines/nav_controls_spec.js | 4 ++-- spec/javascripts/pipelines/pipelines_spec.js | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'spec') diff --git a/spec/javascripts/pipelines/nav_controls_spec.js b/spec/javascripts/pipelines/nav_controls_spec.js index f4cdc1d21ae..d6232f5c567 100644 --- a/spec/javascripts/pipelines/nav_controls_spec.js +++ b/spec/javascripts/pipelines/nav_controls_spec.js @@ -69,11 +69,11 @@ describe('Pipelines Nav Controls', () => { }); it('should emit postAction event when reset runner cache button is clicked', () => { - spyOn(component, '$on'); + spyOn(component, '$emit'); component.$el.querySelector('.js-clear-cache').click(); - expect(component.$on).toHaveBeenCalledWith('postAction', 'foo'); + expect(component.$emit).toHaveBeenCalledWith('resetRunnersCache', 'foo'); }); }); }); diff --git a/spec/javascripts/pipelines/pipelines_spec.js b/spec/javascripts/pipelines/pipelines_spec.js index 84fd0329f08..7e242eb45e1 100644 --- a/spec/javascripts/pipelines/pipelines_spec.js +++ b/spec/javascripts/pipelines/pipelines_spec.js @@ -95,16 +95,16 @@ describe('Pipelines', () => { expect(vm.$el.querySelector('.js-pipelines-tab-all').textContent.trim()).toContain('All'); }); - it('renders Run Pipeline button', () => { + it('renders Run Pipeline link', () => { expect(vm.$el.querySelector('.js-run-pipeline').getAttribute('href')).toEqual(paths.newPipelinePath); }); - it('renders CI Lint button', () => { + it('renders CI Lint link', () => { expect(vm.$el.querySelector('.js-ci-lint').getAttribute('href')).toEqual(paths.ciLintPath); }); it('renders Clear Runner Cache button', () => { - expect(vm.$el.querySelector('.js-clear-cache').getAttribute('href')).toEqual(paths.resetCachePath); + expect(vm.$el.querySelector('.js-clear-cache').textContent.trim()).toEqual('Clear Runner Caches'); }); it('renders pipelines table', () => { @@ -139,16 +139,16 @@ describe('Pipelines', () => { expect(vm.$el.querySelector('.js-pipelines-tab-all').textContent.trim()).toContain('All'); }); - it('renders Run Pipeline button', () => { + it('renders Run Pipeline link', () => { expect(vm.$el.querySelector('.js-run-pipeline').getAttribute('href')).toEqual(paths.newPipelinePath); }); - it('renders CI Lint button', () => { + it('renders CI Lint link', () => { expect(vm.$el.querySelector('.js-ci-lint').getAttribute('href')).toEqual(paths.ciLintPath); }); it('renders Clear Runner Cache button', () => { - expect(vm.$el.querySelector('.js-clear-cache').getAttribute('href')).toEqual(paths.resetCachePath); + expect(vm.$el.querySelector('.js-clear-cache').textContent.trim()).toEqual('Clear Runner Caches'); }); it('renders tab empty state', () => { @@ -218,7 +218,7 @@ describe('Pipelines', () => { it('renders buttons', () => { expect(vm.$el.querySelector('.js-run-pipeline').getAttribute('href')).toEqual(paths.newPipelinePath); expect(vm.$el.querySelector('.js-ci-lint').getAttribute('href')).toEqual(paths.ciLintPath); - expect(vm.$el.querySelector('.js-clear-cache').getAttribute('href')).toEqual(paths.resetCachePath); + expect(vm.$el.querySelector('.js-clear-cache').textContent.trim()).toEqual('Clear Runner Caches'); }); it('renders error state', () => { -- cgit v1.2.1