Skip to content

Commit 9403c71

Browse files
bug fixes post testing (#3136)
1 parent bd74a93 commit 9403c71

File tree

6 files changed

+14
-25
lines changed

6 files changed

+14
-25
lines changed

packages/destination-actions/src/destinations/attentive/ecommEvent/__tests__/__snapshots__/snapshot.test.ts.snap

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ Object {
66
Object {
77
"name": "Test Product",
88
"price": Array [
9-
100,
10-
"USD",
9+
Object {
10+
"currency": "USD",
11+
"value": 100,
12+
},
1113
],
1214
"productId": "test-product-id",
1315
"productImage": "https://example.com/image.jpg",
@@ -33,8 +35,10 @@ Object {
3335
Object {
3436
"name": "Test Product",
3537
"price": Array [
36-
100,
37-
"USD",
38+
Object {
39+
"currency": "USD",
40+
"value": 100,
41+
},
3842
],
3943
"productId": "test-product-id",
4044
"productImage": "https://example.com/image.jpg",

packages/destination-actions/src/destinations/attentive/ecommEvent/__tests__/index.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('eCommerce API - Product View, Add to Cart, Purchase', () => {
6464
{
6565
productId: 'prod_1',
6666
productVariantId: 'variant_1',
67-
price: [19.99, 'USD'],
67+
price: [{ value: 19.99, currency: 'USD' }],
6868
productImage: 'https://example.com/image.png',
6969
productUrl: 'https://example.com/product/prod_1',
7070
name: 'Test Product',
@@ -122,7 +122,7 @@ describe('eCommerce API - Product View, Add to Cart, Purchase', () => {
122122
{
123123
productId: 'prod_1',
124124
productVariantId: 'variant_1',
125-
price: [19.99, 'USD'],
125+
price: [{ value: 19.99, currency: 'USD' }],
126126
productImage: 'https://example.com/image.png',
127127
productUrl: 'https://example.com/product/prod_1',
128128
name: 'Test Product',
@@ -180,7 +180,7 @@ describe('eCommerce API - Product View, Add to Cart, Purchase', () => {
180180
{
181181
productId: 'prod_1',
182182
productVariantId: 'variant_1',
183-
price: [19.99, 'USD'],
183+
price: [{ value: 19.99, currency: 'USD' }],
184184
productImage: 'https://example.com/image.png',
185185
productUrl: 'https://example.com/product/prod_1',
186186
name: 'Test Product',

packages/destination-actions/src/destinations/attentive/fields.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -193,27 +193,13 @@ export const locale: InputField = {
193193
description: 'User locale. e.g. "en-US". Either Locale or Signup Source ID is required.',
194194
type: 'string',
195195
allowNull: false,
196-
required: {
197-
match: 'any',
198-
conditions: [
199-
{ fieldKey: 'signUpSourceId', operator: 'is', value: undefined },
200-
{ fieldKey: 'signUpSourceId', operator: 'is', value: "" }
201-
]
202-
},
203196
default: { '@path': '$.context.locale' }
204197
}
205198

206199
export const signUpSourceId: InputField = {
207200
label: 'Signup Source ID',
208201
description: 'A unique identifier for the sign up source. Talk to your Attentive represenative. Either Locale or Signup Source ID is required.',
209-
type: 'string',
210-
required: {
211-
match: 'any',
212-
conditions: [
213-
{ fieldKey: 'locale', operator: 'is', value: undefined },
214-
{ fieldKey: 'locale', operator: 'is', value: "" }
215-
]
216-
}
202+
type: 'string'
217203
}
218204

219205
export const singleOptIn: InputField = {

packages/destination-actions/src/destinations/attentive/functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function formatUser(userIdentifiers: UserIdentifiers): User {
5353
function formatItems(items: Items): Array<Item> {
5454
return items.map(({ value, currency, ...rest }) => ({
5555
...rest,
56-
price: currency !== undefined && currency !== null && currency !== '' ? [value, currency] : [value]
56+
price: currency !== undefined && currency !== null && currency !== '' ? [{value, currency}] : [{value}]
5757
}))
5858
}
5959

packages/destination-actions/src/destinations/attentive/subscribeUser/__tests__/__snapshots__/snapshot.test.ts.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Object {
2727
"country": "US",
2828
"language": "en",
2929
},
30-
"signUpSourceId": "*Cc5M#wXxFe",
3130
"subscriptionType": "MARKETING",
3231
"user": Object {
3332
"externalIdentifiers": Object {

packages/destination-actions/src/destinations/attentive/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export interface Item {
4343
productImage?: string
4444
productUrl?: string
4545
name?: string
46-
price: [value: number, currency?: string]
46+
price: [{value: number, currency?: string}]
4747
quantity?: number
4848
}
4949
export type SubscriptionType = typeof SUBSCRIPTION_TYPES[number]

0 commit comments

Comments
 (0)