diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-10-09 07:45:51 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-10-09 07:45:51 +0000 |
commit | ccf31a13c5ff253256f5d904bf290c5285b2eeab (patch) | |
tree | 901d91d215715445ebff9779599332501a1cd7d1 /spec/javascripts/cycle_analytics | |
parent | 91f1d652f5a0ab82784fed6d81501d03113d2cd7 (diff) | |
download | gitlab-ce-ccf31a13c5ff253256f5d904bf290c5285b2eeab.tar.gz |
Move cycle analytics banner into a vue file
Diffstat (limited to 'spec/javascripts/cycle_analytics')
-rw-r--r-- | spec/javascripts/cycle_analytics/banner_spec.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/javascripts/cycle_analytics/banner_spec.js b/spec/javascripts/cycle_analytics/banner_spec.js new file mode 100644 index 00000000000..fb6b7fee168 --- /dev/null +++ b/spec/javascripts/cycle_analytics/banner_spec.js @@ -0,0 +1,41 @@ +import Vue from 'vue'; +import banner from '~/cycle_analytics/components/banner.vue'; +import mountComponent from '../helpers/vue_mount_component_helper'; + +describe('Cycle analytics banner', () => { + let vm; + + beforeEach(() => { + const Component = Vue.extend(banner); + vm = mountComponent(Component, { + documentationLink: 'path', + }); + }); + + afterEach(() => { + vm.$destroy(); + }); + + it('should render cycle analytics information', () => { + expect( + vm.$el.querySelector('h4').textContent.trim(), + ).toEqual('Introducing Cycle Analytics'); + expect( + vm.$el.querySelector('p').textContent.trim(), + ).toContain('Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.'); + expect( + vm.$el.querySelector('a').textContent.trim(), + ).toEqual('Read more'); + expect( + vm.$el.querySelector('a').getAttribute('href'), + ).toEqual('path'); + }); + + it('should emit an event when close button is clicked', () => { + spyOn(vm, '$emit'); + + vm.$el.querySelector('.js-ca-dismiss-button').click(); + + expect(vm.$emit).toHaveBeenCalled(); + }); +}); |