Commit 8864beb2 authored by Sarah Groff Hennigh-Palermo's avatar Sarah Groff Hennigh-Palermo

Merge branch 'count-feature-flag-toggles-table' into 'master'

Add Snowplow to Toggles on Feature Flag Table

See merge request gitlab-org/gitlab!39995
parents 71675489 fd3fa425
......@@ -155,6 +155,9 @@ export default {
v-if="featureFlag.update_path"
:value="featureFlag.active"
:disabled="statusToggleDisabled(featureFlag)"
data-track-event="click_button"
data-track-label="feature_flag_toggle"
data-track-context="feature_flag_activity"
@change="toggleFeatureFlag(featureFlag)"
/>
<gl-badge v-else-if="featureFlag.active" variant="success">
......
---
title: Add Snowplow to Toggles on Feature Flag Table
merge_request: 39995
author:
type: other
......@@ -11,6 +11,7 @@ import {
LEGACY_FLAG,
DEFAULT_PERCENT_ROLLOUT,
} from 'ee/feature_flags/constants';
import { mockTracking } from 'helpers/tracking_helper';
const getDefaultProps = () => ({
featureFlags: [
......@@ -115,11 +116,13 @@ describe('Feature flag table', () => {
describe('when active and with an update toggle', () => {
let toggle;
let spy;
beforeEach(() => {
props.featureFlags[0].update_path = props.featureFlags[0].destroy_path;
createWrapper(props);
toggle = wrapper.find(GlToggle);
spy = mockTracking('_category_', toggle.element, jest.spyOn);
});
it('should have a toggle', () => {
......@@ -135,6 +138,15 @@ describe('Feature flag table', () => {
expect(wrapper.emitted('toggle-flag')).toEqual([[flag]]);
});
});
it('should track a click', () => {
toggle.trigger('click');
expect(spy).toHaveBeenCalledWith('_category_', 'click_button', {
context: 'feature_flag_activity',
label: 'feature_flag_toggle',
});
});
});
describe('with an active scope and a percentage rollout strategy', () => {
......
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