Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move mixpanel tests to component test suite #2668

Merged
merged 8 commits into from
Oct 4, 2023
46 changes: 29 additions & 17 deletions test/integrations/destinations/mp/processor/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@ const defaultMockFns = () => {
jest.spyOn(Date, 'now').mockImplementation(() => new Date(Date.UTC(2020, 0, 25)).valueOf());
};

const sampleDestination = {
Config: {
apiKey: 'dummyApiKey',
token: 'dummyApiKey2',
prefixProperties: true,
useNativeSDK: false,
},
DestinationDefinition: {
DisplayName: 'Kiss Metrics',
ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie',
Name: 'MIXPANEL',
},
Enabled: true,
ID: '1WhcOCGgj9asZu850HvugU2C3Aq',
Name: 'Kiss Metrics',
Transformations: [],
};

const getDestination = (configValues) => {
koladilip marked this conversation as resolved.
Show resolved Hide resolved
const destination = sampleDestination;
const configKeys = Object.keys(configValues);
configKeys.forEach((key) => {
destination.Config[key] = configValues[key];
});
console.log(destination);
return destination;
};

export const data = [
{
name: 'mp',
Expand All @@ -13,23 +41,7 @@ export const data = [
request: {
body: [
{
destination: {
Config: {
apiKey: 'dummyApiKey',
token: 'dummyApiKey',
prefixProperties: true,
useNativeSDK: false,
},
DestinationDefinition: {
DisplayName: 'Kiss Metrics',
ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie',
Name: 'MIXPANEL',
},
Enabled: true,
ID: '1WhcOCGgj9asZu850HvugU2C3Aq',
Name: 'Kiss Metrics',
Transformations: [],
},
destination: getDestination({ token: 'dummyApiKey' }),
message: {
anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca',
channel: 'web',
Expand Down
Loading