summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorEnrique Alcantara <ealcantara@gitlab.com>2019-04-30 16:24:40 -0400
committerEnrique Alcantara <ealcantara@gitlab.com>2019-04-30 16:24:40 -0400
commitabfdf0a8ea35af7e75425f633ea5a00334de452f (patch)
treea249d5a250ee48c2250161fde69c2927efeec90c /spec
parentca1e906959dec957980ba1594e51d474aac7a193 (diff)
downloadgitlab-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.js15
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', () => {