mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
refactor: Remove any appcues events (#8597)
This commit is contained in:
parent
cd151f1ba9
commit
64b10d7f5c
|
@ -105,9 +105,6 @@ declare global {
|
||||||
};
|
};
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
Cypress: unknown;
|
Cypress: unknown;
|
||||||
Appcues?: {
|
|
||||||
track(event: string, properties?: ITelemetryTrackProperties): void;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,12 +141,12 @@ describe('telemetry', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('track function', () => {
|
describe('track function', () => {
|
||||||
it('should call Rudderstack track method with correct parameters and', () => {
|
it('should call Rudderstack track method with correct parameters', () => {
|
||||||
const trackFunction = vi.spyOn(window.rudderanalytics, 'track');
|
const trackFunction = vi.spyOn(window.rudderanalytics, 'track');
|
||||||
|
|
||||||
const event = 'testEvent';
|
const event = 'testEvent';
|
||||||
const properties = { test: '1' };
|
const properties = { test: '1' };
|
||||||
const options = { withPostHog: false, withAppCues: false };
|
const options = { withPostHog: false };
|
||||||
|
|
||||||
telemetry.track(event, properties, options);
|
telemetry.track(event, properties, options);
|
||||||
|
|
||||||
|
@ -156,27 +156,5 @@ describe('telemetry', () => {
|
||||||
version_cli: MOCK_VERSION_CLI,
|
version_cli: MOCK_VERSION_CLI,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should call Rudderstack track method with correct parameters and withAppCues option set to true', () => {
|
|
||||||
window.Appcues = { track: () => {} };
|
|
||||||
const trackFunction = vi.spyOn(window.rudderanalytics, 'track');
|
|
||||||
const appCuesTrackFunction = vi.spyOn(window.Appcues, 'track');
|
|
||||||
|
|
||||||
const event = 'testEvent';
|
|
||||||
const properties = { test: '1' };
|
|
||||||
const options = { withPostHog: false, withAppCues: true };
|
|
||||||
|
|
||||||
telemetry.track(event, properties, options);
|
|
||||||
|
|
||||||
expect(trackFunction).toHaveBeenCalledTimes(1);
|
|
||||||
expect(trackFunction).toHaveBeenCalledWith(event, {
|
|
||||||
...properties,
|
|
||||||
version_cli: MOCK_VERSION_CLI,
|
|
||||||
});
|
|
||||||
expect(appCuesTrackFunction).toHaveBeenCalledWith(event, {
|
|
||||||
...properties,
|
|
||||||
version_cli: MOCK_VERSION_CLI,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -99,7 +99,7 @@ export class Telemetry {
|
||||||
track(
|
track(
|
||||||
event: string,
|
event: string,
|
||||||
properties?: ITelemetryTrackProperties,
|
properties?: ITelemetryTrackProperties,
|
||||||
options: { withPostHog?: boolean; withAppCues?: boolean } = {},
|
options: { withPostHog?: boolean } = {},
|
||||||
) {
|
) {
|
||||||
if (!this.rudderStack) return;
|
if (!this.rudderStack) return;
|
||||||
|
|
||||||
|
@ -113,10 +113,6 @@ export class Telemetry {
|
||||||
if (options.withPostHog) {
|
if (options.withPostHog) {
|
||||||
usePostHog().capture(event, updatedProperties);
|
usePostHog().capture(event, updatedProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.withAppCues && window.Appcues) {
|
|
||||||
window.Appcues.track(event, updatedProperties);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
page(route: Route) {
|
page(route: Route) {
|
||||||
|
|
|
@ -3579,7 +3579,6 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
withPostHog: true,
|
withPostHog: true,
|
||||||
withAppCues: true,
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue