@simplybusiness/services 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/index.js +15 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/meta.json +6 -6
- package/dist/esm/index.js +15 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/meta.json +6 -6
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/src/airbrake/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/airbrake/index.ts +1 -1
- package/src/snowplow/event-definitions/coverage-selection.test.ts +38 -0
- package/src/snowplow/event-definitions/coverage-selection.ts +14 -0
package/package.json
CHANGED
package/src/airbrake/index.ts
CHANGED
|
@@ -130,4 +130,42 @@ describe("coverageSelectionEventDefinitions", () => {
|
|
|
130
130
|
expect("data" in result && result.data.vertical).toBe("");
|
|
131
131
|
});
|
|
132
132
|
});
|
|
133
|
+
|
|
134
|
+
describe("learnMoreModalOpened", () => {
|
|
135
|
+
it("should create correct structured event payload", () => {
|
|
136
|
+
const params = {
|
|
137
|
+
product: "general_liability",
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const result = findEventByName(
|
|
141
|
+
coverageSelectionEventDefinitions,
|
|
142
|
+
"learnMoreModalOpened",
|
|
143
|
+
).makePayload(params);
|
|
144
|
+
|
|
145
|
+
expect(result).toEqual({
|
|
146
|
+
category: "coverage_selection",
|
|
147
|
+
action: "learn_more_modal_opened",
|
|
148
|
+
label: "general_liability",
|
|
149
|
+
property: window.location.href,
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it("should handle different product IDs", () => {
|
|
154
|
+
const params = {
|
|
155
|
+
product: "business_owners_policy",
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const result = findEventByName(
|
|
159
|
+
coverageSelectionEventDefinitions,
|
|
160
|
+
"learnMoreModalOpened",
|
|
161
|
+
).makePayload(params);
|
|
162
|
+
|
|
163
|
+
expect(result).toEqual({
|
|
164
|
+
category: "coverage_selection",
|
|
165
|
+
action: "learn_more_modal_opened",
|
|
166
|
+
label: "business_owners_policy",
|
|
167
|
+
property: window.location.href,
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
});
|
|
133
171
|
});
|
|
@@ -33,4 +33,18 @@ export const coverageSelectionEventDefinitions: EventDefinition[] = [
|
|
|
33
33
|
};
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
|
+
{
|
|
37
|
+
name: "learnMoreModalOpened",
|
|
38
|
+
type: "structured",
|
|
39
|
+
makePayload: params => {
|
|
40
|
+
const { product } = params as ParamsType & { product: string };
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
category: "coverage_selection",
|
|
44
|
+
action: "learn_more_modal_opened",
|
|
45
|
+
label: product,
|
|
46
|
+
property: window.location.href,
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
},
|
|
36
50
|
];
|