Commit c63afd30 authored by Filipa Lacerda's avatar Filipa Lacerda

Fix broken tests

parent 318aeffc
...@@ -69,11 +69,11 @@ describe('Pipelines Nav Controls', () => { ...@@ -69,11 +69,11 @@ describe('Pipelines Nav Controls', () => {
}); });
it('should emit postAction event when reset runner cache button is clicked', () => { 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(); component.$el.querySelector('.js-clear-cache').click();
expect(component.$on).toHaveBeenCalledWith('postAction', 'foo'); expect(component.$emit).toHaveBeenCalledWith('resetRunnersCache', 'foo');
}); });
}); });
}); });
...@@ -95,16 +95,16 @@ describe('Pipelines', () => { ...@@ -95,16 +95,16 @@ describe('Pipelines', () => {
expect(vm.$el.querySelector('.js-pipelines-tab-all').textContent.trim()).toContain('All'); 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); 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); expect(vm.$el.querySelector('.js-ci-lint').getAttribute('href')).toEqual(paths.ciLintPath);
}); });
it('renders Clear Runner Cache button', () => { 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', () => { it('renders pipelines table', () => {
...@@ -139,16 +139,16 @@ describe('Pipelines', () => { ...@@ -139,16 +139,16 @@ describe('Pipelines', () => {
expect(vm.$el.querySelector('.js-pipelines-tab-all').textContent.trim()).toContain('All'); 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); 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); expect(vm.$el.querySelector('.js-ci-lint').getAttribute('href')).toEqual(paths.ciLintPath);
}); });
it('renders Clear Runner Cache button', () => { 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', () => { it('renders tab empty state', () => {
...@@ -218,7 +218,7 @@ describe('Pipelines', () => { ...@@ -218,7 +218,7 @@ describe('Pipelines', () => {
it('renders buttons', () => { it('renders buttons', () => {
expect(vm.$el.querySelector('.js-run-pipeline').getAttribute('href')).toEqual(paths.newPipelinePath); 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-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', () => { it('renders error state', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment