Skip to content

Commit

Permalink
Update unmapped.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
alanjcharles authored May 20, 2024
1 parent 84ffd98 commit 4cbb4e8
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions packages/core/src/plugins/__tests__/consent/unmapped.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,38 @@ describe('Unmapped destinations', () => {
{ autoAddSegmentDestination: true }
);

test('no to all', async () => {
const { client } = createClient();
const testDestinations = setupTestDestinations(client);
await client.init();
const mockConsentStatuses = {
C0001: false,
C0002: false,
C0003: false,
C0004: false,
C0005: false,
};

client.add({
plugin: new ConsentPlugin(
createConsentProvider(mockConsentStatuses),
Object.keys(mockConsentStatuses)
),
});

await client.init();

const segmentDestination = createSegmentWatcher(client);

await client.track('test');

expect(segmentDestination).toHaveBeenCalled();
expect(testDestinations.dest1.track).not.toHaveBeenCalled();
expect(testDestinations.dest2.track).not.toHaveBeenCalled();
expect(testDestinations.dest3.track).not.toHaveBeenCalled();
expect(testDestinations.dest4.track).not.toHaveBeenCalled();
expect(testDestinations.dest5.track).toHaveBeenCalled();
});
// test('no to all', async () => {
// const { client } = createClient();
// const testDestinations = setupTestDestinations(client);
// await client.init();
// const mockConsentStatuses = {
// C0001: false,
// C0002: false,
// C0003: false,
// C0004: false,
// C0005: false,
// };

// client.add({
// plugin: new ConsentPlugin(
// createConsentProvider(mockConsentStatuses),
// Object.keys(mockConsentStatuses)
// ),
// });

// await client.init();

// const segmentDestination = createSegmentWatcher(client);

// await client.track('test');

// expect(segmentDestination).toHaveBeenCalled();
// expect(testDestinations.dest1.track).not.toHaveBeenCalled();
// expect(testDestinations.dest2.track).not.toHaveBeenCalled();
// expect(testDestinations.dest3.track).not.toHaveBeenCalled();
// expect(testDestinations.dest4.track).not.toHaveBeenCalled();
// expect(testDestinations.dest5.track).toHaveBeenCalled();
// });

test('yes to 1', async () => {
const { client } = createClient();
Expand Down

0 comments on commit 4cbb4e8

Please sign in to comment.