-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes implemented following call with Joe
Track() [x] Explicitly indicate which fields are required or optional [x] Look for traits and if not context.traits [x] Need description for the Action [x] Make Timestamp field required [x] Make messageId required. It will always be there. [x] getEventProperties: This line looks incorrect: id: payload.event, [x] source mapping looks incorrect: source: integration?.name == 'Iterable' ? 'Iterable' : 'segment', Identify() [x] Description should be updated. [x] identify() calls are often fired when a trait is collected, or when a userId is collected. [x] Maybe use wording: “Creates or updates a user profile, and adds or updates trait values on the user profile…” [x] Refactor the perform() function group() [x] Group Key - Amend description to better explain that group key is a way to connect multiple organizations together [x] groupId field - Should be updated [x] Consider adding anonymousId as a field [x] Handle when there are no traits.
- Loading branch information
Showing
14 changed files
with
132 additions
and
164 deletions.
There are no files selected for viewing
13 changes: 11 additions & 2 deletions
13
packages/destination-actions/src/destinations/launchpad/generated-types.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ import nock from 'nock' | |
import { createTestIntegration } from '@segment/actions-core' | ||
import Destination from '../../index' | ||
import { SegmentEvent } from '@segment/actions-core' | ||
import { IntegrationError } from '@segment/actions-core' | ||
|
||
const launchpadAPISecret = 'lp-api-key' | ||
const timestamp = '2023-01-28T15:21:15.449Z' | ||
|
@@ -32,15 +31,6 @@ const testGroupIdentify: SegmentEvent = { | |
} | ||
} | ||
|
||
const testGroupIdentifyNoTraits: SegmentEvent = { | ||
messageId: 'test-message-t73406chv4', | ||
timestamp: timestamp, | ||
type: 'group', | ||
groupId: '12381923812', | ||
userId: '[email protected]', | ||
traits: {} | ||
} | ||
|
||
describe('Launchpad.groupIdentifyUser', () => { | ||
it('should convert the type and event name', async () => { | ||
nock('https://data.launchpad.pm').post('/capture').reply(200, {}) | ||
|
@@ -62,23 +52,4 @@ describe('Launchpad.groupIdentifyUser', () => { | |
$set: expect.objectContaining(expectedTraits) | ||
}) | ||
}) | ||
|
||
describe('Launchpad.groupIdentifyUser', () => { | ||
it('when no traits it should give a 400 back', async () => { | ||
nock('https://data.launchpad.pm').post('/capture').reply(400, {}) | ||
|
||
try { | ||
await testDestination.testAction('groupIdentifyUser', { | ||
event: testGroupIdentifyNoTraits, | ||
useDefaultMappings: true, | ||
settings: { | ||
apiSecret: launchpadAPISecret, | ||
sourceName: 'example segment source name' | ||
} | ||
}) | ||
} catch (error) { | ||
expect(error).toBeInstanceOf(IntegrationError) | ||
} | ||
}) | ||
}) | ||
}) |
8 changes: 6 additions & 2 deletions
8
packages/destination-actions/src/destinations/launchpad/groupIdentifyUser/generated-types.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
6 changes: 3 additions & 3 deletions
6
packages/destination-actions/src/destinations/launchpad/identifyUser/generated-types.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.