diff --git a/src/cdk/v2/destinations/algolia/procWorkflow.yaml b/src/cdk/v2/destinations/algolia/procWorkflow.yaml index bbef23c603..765431d396 100644 --- a/src/cdk/v2/destinations/algolia/procWorkflow.yaml +++ b/src/cdk/v2/destinations/algolia/procWorkflow.yaml @@ -16,6 +16,7 @@ steps: $.assert(.message.type === {{$.EventType.TRACK}}, "message type " + .message.type + " not supported") $.assert(.message.event, "event is required for track call") + $.assert(typeof .message.event === "string", "event name should be a string") - name: preparePayload template: | diff --git a/test/__tests__/data/algolia_input.json b/test/__tests__/data/algolia_input.json index ce4afa3657..67216fc871 100644 --- a/test/__tests__/data/algolia_input.json +++ b/test/__tests__/data/algolia_input.json @@ -732,5 +732,73 @@ ] } } + }, + { + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "traits": { + "email": "testone@gmail.com", + "firstName": "test", + "lastName": "one" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "page": { + "path": "/destinations/ometria", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/ometria", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "track", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "event": ["abc", "def"], + "userId": "testuserId1", + "properties": { + "filters": ["field1:hello", "val1:val2"] + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "34d8efa09c5b048bbacc6af157f2e687", + "applicationId": "O2YARRI15I", + "eventTypeSettings": [ + { + "from": "product clicked", + "to": "cLick " + } + ] + } + } } ] diff --git a/test/__tests__/data/algolia_output.json b/test/__tests__/data/algolia_output.json index a4cb9b5640..ed02c274e1 100644 --- a/test/__tests__/data/algolia_output.json +++ b/test/__tests__/data/algolia_output.json @@ -113,5 +113,9 @@ { "statusCode": "400", "message": "Missing required value from \"properties.index\"" + }, + { + "statusCode": "400", + "message": "event name should be a string" } ]