Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/analytics-js-common/src/types/Destination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export type DestinationConfig = {

export type Destination = {
id: string;
originalId?: string;
displayName: string;
userFriendlyId: string;
shouldApplyDeviceModeTransformation: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,9 @@ describe('deviceModeDestinations utils', () => {
// Enabled status should match override
expect(dest1Clones[0]?.enabled).toBe(true);
expect(dest1Clones[1]?.enabled).toBe(true);
// cloned destination should have originalId and originalId should be the original destination id
expect(dest1Clones[0]?.originalId).toBe('dest1');
expect(dest1Clones[1]?.originalId).toBe('dest1');

// dest2 and dest3 should be unchanged
expect(result.find(d => d.id === 'dest3')).toBe(mockDestinations[2]);
Expand All @@ -568,6 +571,7 @@ describe('deviceModeDestinations utils', () => {
expect(dest2Clones[0]).toBeDefined();
expect(dest2Clones[0]?.id).toBe('dest2_1');
expect(dest2Clones[0]?.userFriendlyId).toBe('dest2_friendly_1');
expect(dest2Clones[0]?.originalId).toBe('dest2');

// Config and enabled status should match each override
expect(dest2Clones[0]?.config.apiKey).toBe('cloneA');
Expand Down Expand Up @@ -608,6 +612,9 @@ describe('deviceModeDestinations utils', () => {
expect(dest3Clones[1]?.config?.extra).toBe(123);
expect(dest3Clones[0]?.enabled).toBe(true);
expect(dest3Clones[1]?.enabled).toBe(true);
// cloned destination should have originalId and originalId should be the original destination id
expect(dest3Clones[0]?.originalId).toBe('dest3');
expect(dest3Clones[1]?.originalId).toBe('dest3');
// inherit other config properties
expect(dest3Clones[0]?.config?.eventFilteringOption).toBe('disable');
expect(dest3Clones[1]?.config?.eventFilteringOption).toBe('disable');
Expand Down
Loading
Loading