-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter out integrations in consent (#912)
- Loading branch information
Showing
5 changed files
with
95 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@segment/analytics-consent-tools': patch | ||
--- | ||
|
||
Support classic destinations and locally installed action destinations by removing integrations. |
37 changes: 37 additions & 0 deletions
37
packages/consent/consent-tools/src/domain/__tests__/assertions/integrations-assertions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { CDNSettings } from '../../../types' | ||
|
||
/** | ||
* Assert integrations/remote plugins contain only the given integrations | ||
*/ | ||
export const assertIntegrationsContainOnly = ( | ||
/** | ||
* integration creation names | ||
*/ | ||
creationNames: string[], | ||
/** | ||
* mock CDN settings | ||
*/ | ||
originalCDNSettings: CDNSettings, | ||
/** | ||
* updated CDN settings | ||
*/ | ||
updatedCDNSettings: CDNSettings | ||
) => { | ||
expect(updatedCDNSettings.remotePlugins).toEqual( | ||
originalCDNSettings.remotePlugins?.filter((p) => | ||
// enabled consent | ||
creationNames.includes(p.creationName) | ||
) | ||
) | ||
|
||
// integrations should also be filtered | ||
const integrations = Object.fromEntries( | ||
Object.entries(originalCDNSettings.integrations).filter( | ||
([creationName]) => { | ||
return [...creationNames, 'Segment.io'].includes(creationName) | ||
} | ||
) | ||
) | ||
|
||
expect(updatedCDNSettings.integrations).toEqual(integrations) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters