|
366 | 366 | " pm.test(\"Profile was created in klaviyo\", function () {", |
367 | 367 | " pm.response.to.have.status(expectedHttpStatus);", |
368 | 368 | " pm.expect(jsonData.data.length).to.be.above(0);", |
369 | | - " pm.expect(jsonData.data[0].attributes.email).to.eql(pm.environment.get(\"customer-email\"));", |
| 369 | + " pm.expect(jsonData.data[0].attributes.email.toLowerCase()).to.eql(pm.environment.get(\"customer-email\").toLowerCase());", |
370 | 370 | " });", |
371 | 371 | "}", |
372 | 372 | "" |
|
1984 | 1984 | " pm.expect(jsonData.data.length).to.be.above(0);", |
1985 | 1985 | " });", |
1986 | 1986 | "", |
1987 | | - " const profile = jsonData.data.find(p => p.attributes.email === pm.environment.get(\"dedup-customer-email\"));", |
| 1987 | + " const profile = jsonData.data.find(p => p.attributes.email.toLowerCase() === pm.environment.get(\"dedup-customer-email\").toLowerCase());", |
1988 | 1988 | " if (profile && profile.id) {", |
1989 | 1989 | " pm.environment.set(\"existing-klaviyo-profile-id\", profile.id);", |
1990 | 1990 | " console.log(\"Found existing profile with ID: \" + profile.id);", |
|
2287 | 2287 | "}", |
2288 | 2288 | "", |
2289 | 2289 | "const jsonData = pm.response.json();", |
2290 | | - "const profile = jsonData.data ? jsonData.data.find(p => p.attributes.email === pm.environment.get(\"dedup-customer-email\")) : null;", |
| 2290 | + "const profile = jsonData.data ? jsonData.data.find(p => p.attributes.email.toLowerCase() === pm.environment.get(\"dedup-customer-email\").toLowerCase()) : null;", |
2291 | 2291 | "const profileFound = profile !== null && profile !== undefined;", |
2292 | 2292 | "const externalIdSet = profile && profile.attributes && profile.attributes.external_id === pm.environment.get(\"customer-id\");", |
2293 | 2293 | "const elapsedTime = Date.now() - parseInt(startTime, 10);", |
|
0 commit comments