diff options
author | Enrique Alcantara <ealcantara@gitlab.com> | 2019-04-30 16:24:40 -0400 |
---|---|---|
committer | Enrique Alcantara <ealcantara@gitlab.com> | 2019-04-30 16:24:40 -0400 |
commit | abfdf0a8ea35af7e75425f633ea5a00334de452f (patch) | |
tree | a249d5a250ee48c2250161fde69c2927efeec90c /spec | |
parent | ca1e906959dec957980ba1594e51d474aac7a193 (diff) | |
download | gitlab-ce-10763-track-uninstall-button-clicks.tar.gz |
Track clicks on uninstall app button10763-track-uninstall-button-clicks
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/clusters/components/uninstall_application_confirmation_modal_spec.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/frontend/clusters/components/uninstall_application_confirmation_modal_spec.js b/spec/frontend/clusters/components/uninstall_application_confirmation_modal_spec.js index 6a7126b45cd..fbba1b925d9 100644 --- a/spec/frontend/clusters/components/uninstall_application_confirmation_modal_spec.js +++ b/spec/frontend/clusters/components/uninstall_application_confirmation_modal_spec.js @@ -29,10 +29,19 @@ describe('UninstallApplicationConfirmationModal', () => { expect(wrapper.find(GlModal).attributes('ok-title')).toEqual(`Uninstall ${appTitle}`); }); - it('triggers confirm event when ok button is clicked', () => { - wrapper.find(GlModal).vm.$emit('ok'); + describe('when ok button is clicked', () => { + beforeEach(() => { + jest.spyOn(wrapper.vm, 'trackUninstallApplicationClick'); + wrapper.find(GlModal).vm.$emit('ok'); + }); + + it('triggers confirm event when ok button is clicked', () => { + expect(wrapper.emitted('confirm')).toBeTruthy(); + }); - expect(wrapper.emitted('confirm')).toBeTruthy(); + it('tracks event using stats package', () => { + expect(wrapper.vm.trackUninstallApplicationClick).toHaveBeenCalledWith(INGRESS); + }); }); it('displays a warning text indicating the app will be uninstalled', () => { |