-
Notifications
You must be signed in to change notification settings - Fork 43
/
C14403.js
67 lines (54 loc) · 1.98 KB
/
C14403.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { t, ClientFunction } from "testcafe";
import createNetworkLogger from "../../helpers/networkLogger";
import getResponseBody from "../../helpers/networkLogger/getResponseBody";
import { responseStatus } from "../../helpers/assertions";
import createFixture from "../../helpers/createFixture";
import createResponse from "../../helpers/createResponse";
import { ECID as ECID_REGEX } from "../../helpers/constants/regex";
import {
compose,
orgMainConfigMain,
debugEnabled,
migrationDisabled
} from "../../helpers/constants/configParts";
import createAlloyProxy from "../../helpers/createAlloyProxy";
const config = compose(
orgMainConfigMain,
debugEnabled,
migrationDisabled
);
const networkLogger = createNetworkLogger();
createFixture({
title:
"C14403: When ID migration is disabled and no legacy AMCV cookie is found, no AMCV cookie should be created",
requestHooks: [networkLogger.edgeEndpointLogs]
});
test.meta({
ID: "C14403",
SEVERITY: "P0",
TEST_RUN: "Regression"
});
const getDocumentCookie = ClientFunction(() => document.cookie);
test("Test C14403: When ID migration is disabled and no legacy AMCV cookie is found, no AMCV cookie should be created", async () => {
const alloy = createAlloyProxy();
await alloy.configure(config);
await alloy.sendEvent({ renderDecisions: true });
await responseStatus(networkLogger.edgeEndpointLogs.requests, 200);
await t.expect(networkLogger.edgeEndpointLogs.requests.length).eql(1);
const response = JSON.parse(
getResponseBody(networkLogger.edgeEndpointLogs.requests[0])
);
const payloads = createResponse({ content: response }).getPayloadsByType(
"identity:result"
);
const ecidPayload = payloads.filter(
payload => payload.namespace.code === "ECID"
)[0];
await t.expect(ecidPayload.id).match(ECID_REGEX);
const documentCookie = await getDocumentCookie();
await t
.expect(documentCookie)
.notContains(
`AMCV_5BFE274A5F6980A50A495C08%40AdobeOrg=MCMID|${ecidPayload.id}`
);
});