@cimplify/sdk 0.44.18 → 0.44.20
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/dist/{chunk-VDH3O7UB.mjs → chunk-GLOO4HUN.mjs} +82 -10
- package/dist/{chunk-MJBSVUHO.mjs → chunk-KSKZAXG2.mjs} +2 -0
- package/dist/{chunk-CCSONJCO.js → chunk-PGSM3NQ2.js} +2 -0
- package/dist/{chunk-53J2WE4S.js → chunk-Q4I7JRGO.js} +86 -10
- package/dist/mock/cli.mjs +2 -0
- package/dist/mock/library.js +2 -0
- package/dist/mock/library.mjs +2 -0
- package/dist/mock/msw.js +2 -0
- package/dist/mock/msw.mjs +2 -0
- package/dist/styles.css +1 -1
- package/dist/testing/msw.js +2 -2
- package/dist/testing/msw.mjs +1 -1
- package/dist/testing/suite.js +21 -21
- package/dist/testing/suite.mjs +2 -2
- package/dist/testing.d.mts +329 -27
- package/dist/testing.d.ts +329 -27
- package/dist/testing.js +89 -73
- package/dist/testing.mjs +3 -3
- package/package.json +1 -1
- package/templates/storefront-fashion/e2e/visual.spec.ts +52 -0
- package/templates/storefront-fashion/package.json +4 -1
- package/templates/storefront-fashion/playwright.config.ts +48 -0
package/dist/testing.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQ4I7JRGO_js = require('./chunk-Q4I7JRGO.js');
|
|
4
4
|
require('./chunk-3FS3ZDKX.js');
|
|
5
5
|
require('./chunk-HBRCVJL4.js');
|
|
6
6
|
require('./chunk-BN2CXGMO.js');
|
|
7
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-PGSM3NQ2.js');
|
|
8
8
|
require('./chunk-QBQCMQ4F.js');
|
|
9
9
|
var zod = require('zod');
|
|
10
10
|
|
|
11
11
|
var PUBLIC_SCHEMAS = {
|
|
12
|
-
Brand:
|
|
13
|
-
AddItemPayload:
|
|
14
|
-
Cart:
|
|
15
|
-
CartItem:
|
|
16
|
-
CartPricing:
|
|
17
|
-
CheckoutBody:
|
|
18
|
-
CheckoutResponse:
|
|
19
|
-
VariantInfo:
|
|
12
|
+
Brand: chunkQ4I7JRGO_js.BrandSchema,
|
|
13
|
+
AddItemPayload: chunkQ4I7JRGO_js.AddItemPayloadSchema,
|
|
14
|
+
Cart: chunkQ4I7JRGO_js.CartSchema,
|
|
15
|
+
CartItem: chunkQ4I7JRGO_js.CartItemSchema,
|
|
16
|
+
CartPricing: chunkQ4I7JRGO_js.CartPricingSchema,
|
|
17
|
+
CheckoutBody: chunkQ4I7JRGO_js.CheckoutBodySchema,
|
|
18
|
+
CheckoutResponse: chunkQ4I7JRGO_js.CheckoutResponseSchema,
|
|
19
|
+
VariantInfo: chunkQ4I7JRGO_js.VariantInfoSchema
|
|
20
20
|
};
|
|
21
21
|
function exportJsonSchemas() {
|
|
22
22
|
const out = {};
|
|
23
23
|
for (const [name, schema] of Object.entries(PUBLIC_SCHEMAS)) {
|
|
24
|
-
const meta =
|
|
25
|
-
const json = zod.z.toJSONSchema(schema, { metadata:
|
|
24
|
+
const meta = chunkQ4I7JRGO_js.cimplifyRegistry.get(schema);
|
|
25
|
+
const json = zod.z.toJSONSchema(schema, { metadata: chunkQ4I7JRGO_js.cimplifyRegistry });
|
|
26
26
|
if (meta) {
|
|
27
27
|
json.$id = meta.id;
|
|
28
28
|
json["x-cimplify-version"] = meta.version;
|
|
@@ -34,16 +34,16 @@ function exportJsonSchemas() {
|
|
|
34
34
|
function listRegisteredSchemas() {
|
|
35
35
|
const entries = [];
|
|
36
36
|
for (const schema of [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
chunkQ4I7JRGO_js.BrandSchema,
|
|
38
|
+
chunkQ4I7JRGO_js.AddItemPayloadSchema,
|
|
39
|
+
chunkQ4I7JRGO_js.CartSchema,
|
|
40
|
+
chunkQ4I7JRGO_js.CartItemSchema,
|
|
41
|
+
chunkQ4I7JRGO_js.CartPricingSchema,
|
|
42
|
+
chunkQ4I7JRGO_js.CheckoutBodySchema,
|
|
43
|
+
chunkQ4I7JRGO_js.CheckoutResponseSchema,
|
|
44
|
+
chunkQ4I7JRGO_js.VariantInfoSchema
|
|
45
45
|
]) {
|
|
46
|
-
const meta =
|
|
46
|
+
const meta = chunkQ4I7JRGO_js.cimplifyRegistry.get(schema);
|
|
47
47
|
if (meta) entries.push({ schema, meta });
|
|
48
48
|
}
|
|
49
49
|
return entries;
|
|
@@ -51,211 +51,227 @@ function listRegisteredSchemas() {
|
|
|
51
51
|
|
|
52
52
|
Object.defineProperty(exports, "AddItemPayloadSchema", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkQ4I7JRGO_js.AddItemPayloadSchema; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "AddOnDetailsSchema", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkQ4I7JRGO_js.AddOnDetailsSchema; }
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "AddOnGroupDetailsSchema", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () { return chunkQ4I7JRGO_js.AddOnGroupDetailsSchema; }
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(exports, "AddOnInDetailsSchema", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () { return chunkQ4I7JRGO_js.AddOnInDetailsSchema; }
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(exports, "AddOnOptionDetailsSchema", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () { return chunkQ4I7JRGO_js.AddOnOptionDetailsSchema; }
|
|
59
71
|
});
|
|
60
72
|
Object.defineProperty(exports, "AuthorizationTypeSchema", {
|
|
61
73
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkQ4I7JRGO_js.AuthorizationTypeSchema; }
|
|
63
75
|
});
|
|
64
76
|
Object.defineProperty(exports, "BrandContactSchema", {
|
|
65
77
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkQ4I7JRGO_js.BrandContactSchema; }
|
|
67
79
|
});
|
|
68
80
|
Object.defineProperty(exports, "BrandFaqSchema", {
|
|
69
81
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkQ4I7JRGO_js.BrandFaqSchema; }
|
|
71
83
|
});
|
|
72
84
|
Object.defineProperty(exports, "BrandHeroSchema", {
|
|
73
85
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkQ4I7JRGO_js.BrandHeroSchema; }
|
|
75
87
|
});
|
|
76
88
|
Object.defineProperty(exports, "BrandNavLinkSchema", {
|
|
77
89
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkQ4I7JRGO_js.BrandNavLinkSchema; }
|
|
79
91
|
});
|
|
80
92
|
Object.defineProperty(exports, "BrandPolicyPageSchema", {
|
|
81
93
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunkQ4I7JRGO_js.BrandPolicyPageSchema; }
|
|
83
95
|
});
|
|
84
96
|
Object.defineProperty(exports, "BrandPolicySectionSchema", {
|
|
85
97
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunkQ4I7JRGO_js.BrandPolicySectionSchema; }
|
|
87
99
|
});
|
|
88
100
|
Object.defineProperty(exports, "BrandSchema", {
|
|
89
101
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunkQ4I7JRGO_js.BrandSchema; }
|
|
91
103
|
});
|
|
92
104
|
Object.defineProperty(exports, "BrandSocialSchema", {
|
|
93
105
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunkQ4I7JRGO_js.BrandSocialSchema; }
|
|
95
107
|
});
|
|
96
108
|
Object.defineProperty(exports, "BundleResolvedSchema", {
|
|
97
109
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunkQ4I7JRGO_js.BundleResolvedSchema; }
|
|
99
111
|
});
|
|
100
112
|
Object.defineProperty(exports, "BundleSelectionInputSchema", {
|
|
101
113
|
enumerable: true,
|
|
102
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunkQ4I7JRGO_js.BundleSelectionInputSchema; }
|
|
103
115
|
});
|
|
104
116
|
Object.defineProperty(exports, "CartItemSchema", {
|
|
105
117
|
enumerable: true,
|
|
106
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunkQ4I7JRGO_js.CartItemSchema; }
|
|
107
119
|
});
|
|
108
120
|
Object.defineProperty(exports, "CartPricingSchema", {
|
|
109
121
|
enumerable: true,
|
|
110
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunkQ4I7JRGO_js.CartPricingSchema; }
|
|
111
123
|
});
|
|
112
124
|
Object.defineProperty(exports, "CartSchema", {
|
|
113
125
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunkQ4I7JRGO_js.CartSchema; }
|
|
115
127
|
});
|
|
116
128
|
Object.defineProperty(exports, "CheckoutBodySchema", {
|
|
117
129
|
enumerable: true,
|
|
118
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunkQ4I7JRGO_js.CheckoutBodySchema; }
|
|
119
131
|
});
|
|
120
132
|
Object.defineProperty(exports, "CheckoutCustomerSchema", {
|
|
121
133
|
enumerable: true,
|
|
122
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunkQ4I7JRGO_js.CheckoutCustomerSchema; }
|
|
123
135
|
});
|
|
124
136
|
Object.defineProperty(exports, "CheckoutResponseSchema", {
|
|
125
137
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunkQ4I7JRGO_js.CheckoutResponseSchema; }
|
|
127
139
|
});
|
|
128
140
|
Object.defineProperty(exports, "ChosenPriceSchema", {
|
|
129
141
|
enumerable: true,
|
|
130
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunkQ4I7JRGO_js.ChosenPriceSchema; }
|
|
131
143
|
});
|
|
132
144
|
Object.defineProperty(exports, "CompositeResolvedSchema", {
|
|
133
145
|
enumerable: true,
|
|
134
|
-
get: function () { return
|
|
146
|
+
get: function () { return chunkQ4I7JRGO_js.CompositeResolvedSchema; }
|
|
135
147
|
});
|
|
136
148
|
Object.defineProperty(exports, "CompositeSelectionInputSchema", {
|
|
137
149
|
enumerable: true,
|
|
138
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunkQ4I7JRGO_js.CompositeSelectionInputSchema; }
|
|
139
151
|
});
|
|
140
152
|
Object.defineProperty(exports, "CountryCodeSchema", {
|
|
141
153
|
enumerable: true,
|
|
142
|
-
get: function () { return
|
|
154
|
+
get: function () { return chunkQ4I7JRGO_js.CountryCodeSchema; }
|
|
143
155
|
});
|
|
144
156
|
Object.defineProperty(exports, "CurrencyCodeSchema", {
|
|
145
157
|
enumerable: true,
|
|
146
|
-
get: function () { return
|
|
158
|
+
get: function () { return chunkQ4I7JRGO_js.CurrencyCodeSchema; }
|
|
147
159
|
});
|
|
148
160
|
Object.defineProperty(exports, "CustomerInputValueSchema", {
|
|
149
161
|
enumerable: true,
|
|
150
|
-
get: function () { return
|
|
162
|
+
get: function () { return chunkQ4I7JRGO_js.CustomerInputValueSchema; }
|
|
151
163
|
});
|
|
152
164
|
Object.defineProperty(exports, "DiscountDetailsSchema", {
|
|
153
165
|
enumerable: true,
|
|
154
|
-
get: function () { return
|
|
166
|
+
get: function () { return chunkQ4I7JRGO_js.DiscountDetailsSchema; }
|
|
155
167
|
});
|
|
156
168
|
Object.defineProperty(exports, "IsoDateTimeSchema", {
|
|
157
169
|
enumerable: true,
|
|
158
|
-
get: function () { return
|
|
170
|
+
get: function () { return chunkQ4I7JRGO_js.IsoDateTimeSchema; }
|
|
159
171
|
});
|
|
160
172
|
Object.defineProperty(exports, "LineTypeSchema", {
|
|
161
173
|
enumerable: true,
|
|
162
|
-
get: function () { return
|
|
174
|
+
get: function () { return chunkQ4I7JRGO_js.LineTypeSchema; }
|
|
163
175
|
});
|
|
164
176
|
Object.defineProperty(exports, "LocaleSchema", {
|
|
165
177
|
enumerable: true,
|
|
166
|
-
get: function () { return
|
|
178
|
+
get: function () { return chunkQ4I7JRGO_js.LocaleSchema; }
|
|
167
179
|
});
|
|
168
180
|
Object.defineProperty(exports, "MoneyLooseSchema", {
|
|
169
181
|
enumerable: true,
|
|
170
|
-
get: function () { return
|
|
182
|
+
get: function () { return chunkQ4I7JRGO_js.MoneyLooseSchema; }
|
|
171
183
|
});
|
|
172
184
|
Object.defineProperty(exports, "MoneySchema", {
|
|
173
185
|
enumerable: true,
|
|
174
|
-
get: function () { return
|
|
186
|
+
get: function () { return chunkQ4I7JRGO_js.MoneySchema; }
|
|
175
187
|
});
|
|
176
188
|
Object.defineProperty(exports, "NextActionSchema", {
|
|
177
189
|
enumerable: true,
|
|
178
|
-
get: function () { return
|
|
190
|
+
get: function () { return chunkQ4I7JRGO_js.NextActionSchema; }
|
|
179
191
|
});
|
|
180
192
|
Object.defineProperty(exports, "PhoneE164Schema", {
|
|
181
193
|
enumerable: true,
|
|
182
|
-
get: function () { return
|
|
194
|
+
get: function () { return chunkQ4I7JRGO_js.PhoneE164Schema; }
|
|
183
195
|
});
|
|
184
196
|
Object.defineProperty(exports, "ProductTypeSchema", {
|
|
185
197
|
enumerable: true,
|
|
186
|
-
get: function () { return
|
|
198
|
+
get: function () { return chunkQ4I7JRGO_js.ProductTypeSchema; }
|
|
187
199
|
});
|
|
188
200
|
Object.defineProperty(exports, "SchemaViolationError", {
|
|
189
201
|
enumerable: true,
|
|
190
|
-
get: function () { return
|
|
202
|
+
get: function () { return chunkQ4I7JRGO_js.SchemaViolationError; }
|
|
191
203
|
});
|
|
192
204
|
Object.defineProperty(exports, "SeedNameSchema", {
|
|
193
205
|
enumerable: true,
|
|
194
|
-
get: function () { return
|
|
206
|
+
get: function () { return chunkQ4I7JRGO_js.SeedNameSchema; }
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(exports, "SelectedAddOnOptionSchema", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function () { return chunkQ4I7JRGO_js.SelectedAddOnOptionSchema; }
|
|
195
211
|
});
|
|
196
212
|
Object.defineProperty(exports, "ServiceStatusSchema", {
|
|
197
213
|
enumerable: true,
|
|
198
|
-
get: function () { return
|
|
214
|
+
get: function () { return chunkQ4I7JRGO_js.ServiceStatusSchema; }
|
|
199
215
|
});
|
|
200
216
|
Object.defineProperty(exports, "TimestampSchema", {
|
|
201
217
|
enumerable: true,
|
|
202
|
-
get: function () { return
|
|
218
|
+
get: function () { return chunkQ4I7JRGO_js.TimestampSchema; }
|
|
203
219
|
});
|
|
204
220
|
Object.defineProperty(exports, "VariantDetailsSchema", {
|
|
205
221
|
enumerable: true,
|
|
206
|
-
get: function () { return
|
|
222
|
+
get: function () { return chunkQ4I7JRGO_js.VariantDetailsSchema; }
|
|
207
223
|
});
|
|
208
224
|
Object.defineProperty(exports, "VariantDisplayAttributeSchema", {
|
|
209
225
|
enumerable: true,
|
|
210
|
-
get: function () { return
|
|
226
|
+
get: function () { return chunkQ4I7JRGO_js.VariantDisplayAttributeSchema; }
|
|
211
227
|
});
|
|
212
228
|
Object.defineProperty(exports, "VariantInfoSchema", {
|
|
213
229
|
enumerable: true,
|
|
214
|
-
get: function () { return
|
|
230
|
+
get: function () { return chunkQ4I7JRGO_js.VariantInfoSchema; }
|
|
215
231
|
});
|
|
216
232
|
Object.defineProperty(exports, "assertAddItemPayload", {
|
|
217
233
|
enumerable: true,
|
|
218
|
-
get: function () { return
|
|
234
|
+
get: function () { return chunkQ4I7JRGO_js.assertAddItemPayload; }
|
|
219
235
|
});
|
|
220
236
|
Object.defineProperty(exports, "assertBrand", {
|
|
221
237
|
enumerable: true,
|
|
222
|
-
get: function () { return
|
|
238
|
+
get: function () { return chunkQ4I7JRGO_js.assertBrand; }
|
|
223
239
|
});
|
|
224
240
|
Object.defineProperty(exports, "assertCart", {
|
|
225
241
|
enumerable: true,
|
|
226
|
-
get: function () { return
|
|
242
|
+
get: function () { return chunkQ4I7JRGO_js.assertCart; }
|
|
227
243
|
});
|
|
228
244
|
Object.defineProperty(exports, "assertCartItem", {
|
|
229
245
|
enumerable: true,
|
|
230
|
-
get: function () { return
|
|
246
|
+
get: function () { return chunkQ4I7JRGO_js.assertCartItem; }
|
|
231
247
|
});
|
|
232
248
|
Object.defineProperty(exports, "assertCheckoutBody", {
|
|
233
249
|
enumerable: true,
|
|
234
|
-
get: function () { return
|
|
250
|
+
get: function () { return chunkQ4I7JRGO_js.assertCheckoutBody; }
|
|
235
251
|
});
|
|
236
252
|
Object.defineProperty(exports, "assertCheckoutResponse", {
|
|
237
253
|
enumerable: true,
|
|
238
|
-
get: function () { return
|
|
254
|
+
get: function () { return chunkQ4I7JRGO_js.assertCheckoutResponse; }
|
|
239
255
|
});
|
|
240
256
|
Object.defineProperty(exports, "cimplifyRegistry", {
|
|
241
257
|
enumerable: true,
|
|
242
|
-
get: function () { return
|
|
258
|
+
get: function () { return chunkQ4I7JRGO_js.cimplifyRegistry; }
|
|
243
259
|
});
|
|
244
260
|
Object.defineProperty(exports, "createTestClient", {
|
|
245
261
|
enumerable: true,
|
|
246
|
-
get: function () { return
|
|
262
|
+
get: function () { return chunkQ4I7JRGO_js.createTestClient; }
|
|
247
263
|
});
|
|
248
264
|
Object.defineProperty(exports, "fixtures", {
|
|
249
265
|
enumerable: true,
|
|
250
|
-
get: function () { return
|
|
266
|
+
get: function () { return chunkQ4I7JRGO_js.fixtures; }
|
|
251
267
|
});
|
|
252
268
|
Object.defineProperty(exports, "makeAssertion", {
|
|
253
269
|
enumerable: true,
|
|
254
|
-
get: function () { return
|
|
270
|
+
get: function () { return chunkQ4I7JRGO_js.makeAssertion; }
|
|
255
271
|
});
|
|
256
272
|
Object.defineProperty(exports, "registerSchema", {
|
|
257
273
|
enumerable: true,
|
|
258
|
-
get: function () { return
|
|
274
|
+
get: function () { return chunkQ4I7JRGO_js.registerSchema; }
|
|
259
275
|
});
|
|
260
276
|
exports.exportJsonSchemas = exportJsonSchemas;
|
|
261
277
|
exports.listRegisteredSchemas = listRegisteredSchemas;
|
package/dist/testing.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { VariantInfoSchema, CheckoutResponseSchema, CheckoutBodySchema, CartPricingSchema, CartItemSchema, CartSchema, AddItemPayloadSchema, BrandSchema, cimplifyRegistry } from './chunk-
|
|
2
|
-
export { AddItemPayloadSchema, AddOnDetailsSchema, AuthorizationTypeSchema, BrandContactSchema, BrandFaqSchema, BrandHeroSchema, BrandNavLinkSchema, BrandPolicyPageSchema, BrandPolicySectionSchema, BrandSchema, BrandSocialSchema, BundleResolvedSchema, BundleSelectionInputSchema, CartItemSchema, CartPricingSchema, CartSchema, CheckoutBodySchema, CheckoutCustomerSchema, CheckoutResponseSchema, ChosenPriceSchema, CompositeResolvedSchema, CompositeSelectionInputSchema, CountryCodeSchema, CurrencyCodeSchema, CustomerInputValueSchema, DiscountDetailsSchema, IsoDateTimeSchema, LineTypeSchema, LocaleSchema, MoneyLooseSchema, MoneySchema, NextActionSchema, PhoneE164Schema, ProductTypeSchema, SchemaViolationError, SeedNameSchema, ServiceStatusSchema, TimestampSchema, VariantDetailsSchema, VariantDisplayAttributeSchema, VariantInfoSchema, assertAddItemPayload, assertBrand, assertCart, assertCartItem, assertCheckoutBody, assertCheckoutResponse, cimplifyRegistry, createTestClient, fixtures, makeAssertion, registerSchema } from './chunk-
|
|
1
|
+
import { VariantInfoSchema, CheckoutResponseSchema, CheckoutBodySchema, CartPricingSchema, CartItemSchema, CartSchema, AddItemPayloadSchema, BrandSchema, cimplifyRegistry } from './chunk-GLOO4HUN.mjs';
|
|
2
|
+
export { AddItemPayloadSchema, AddOnDetailsSchema, AddOnGroupDetailsSchema, AddOnInDetailsSchema, AddOnOptionDetailsSchema, AuthorizationTypeSchema, BrandContactSchema, BrandFaqSchema, BrandHeroSchema, BrandNavLinkSchema, BrandPolicyPageSchema, BrandPolicySectionSchema, BrandSchema, BrandSocialSchema, BundleResolvedSchema, BundleSelectionInputSchema, CartItemSchema, CartPricingSchema, CartSchema, CheckoutBodySchema, CheckoutCustomerSchema, CheckoutResponseSchema, ChosenPriceSchema, CompositeResolvedSchema, CompositeSelectionInputSchema, CountryCodeSchema, CurrencyCodeSchema, CustomerInputValueSchema, DiscountDetailsSchema, IsoDateTimeSchema, LineTypeSchema, LocaleSchema, MoneyLooseSchema, MoneySchema, NextActionSchema, PhoneE164Schema, ProductTypeSchema, SchemaViolationError, SeedNameSchema, SelectedAddOnOptionSchema, ServiceStatusSchema, TimestampSchema, VariantDetailsSchema, VariantDisplayAttributeSchema, VariantInfoSchema, assertAddItemPayload, assertBrand, assertCart, assertCartItem, assertCheckoutBody, assertCheckoutResponse, cimplifyRegistry, createTestClient, fixtures, makeAssertion, registerSchema } from './chunk-GLOO4HUN.mjs';
|
|
3
3
|
import './chunk-5OK3YDZC.mjs';
|
|
4
4
|
import './chunk-XZPO5GEM.mjs';
|
|
5
5
|
import './chunk-NRT6PVW5.mjs';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-KSKZAXG2.mjs';
|
|
7
7
|
import './chunk-XPXAZXF2.mjs';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Visual regression on the storefront's key surfaces. Catches CSS / layout
|
|
5
|
+
* drift that the contract harness can't see.
|
|
6
|
+
*
|
|
7
|
+
* Anti-flake notes:
|
|
8
|
+
* - We disable animations (CSS transitions can leave half-frame snapshots).
|
|
9
|
+
* - We mask images (Unsplash / CDN URLs occasionally render slight pixel
|
|
10
|
+
* differences). The container layout is what we're regressing on, not
|
|
11
|
+
* image bytes.
|
|
12
|
+
* - Fonts are served by `next/font` and locked at build time, but if you
|
|
13
|
+
* see flake on a fresh CI runner, `await page.evaluate(() => document.fonts.ready)`
|
|
14
|
+
* before the snapshot.
|
|
15
|
+
*/
|
|
16
|
+
test.describe("visual regression", () => {
|
|
17
|
+
test.beforeEach(async ({ page }) => {
|
|
18
|
+
await page.addStyleTag({
|
|
19
|
+
content: `*, *::before, *::after { animation: none !important; transition: none !important; }`,
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test("homepage", async ({ page }) => {
|
|
24
|
+
await page.goto("/");
|
|
25
|
+
await page.evaluate(() => document.fonts.ready);
|
|
26
|
+
await expect(page).toHaveScreenshot("homepage.png", {
|
|
27
|
+
fullPage: true,
|
|
28
|
+
mask: [page.locator("img")],
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test("shop / catalogue", async ({ page }) => {
|
|
33
|
+
await page.goto("/shop");
|
|
34
|
+
await page.evaluate(() => document.fonts.ready);
|
|
35
|
+
await expect(page).toHaveScreenshot("shop.png", {
|
|
36
|
+
fullPage: true,
|
|
37
|
+
mask: [page.locator("img")],
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("cart drawer after adding a product", async ({ page }) => {
|
|
42
|
+
await page.goto("/products/studio-tee-natural");
|
|
43
|
+
await page.evaluate(() => document.fonts.ready);
|
|
44
|
+
// Click whatever the storefront's primary Add-to-Cart button is.
|
|
45
|
+
await page.getByRole("button", { name: /add to cart/i }).first().click();
|
|
46
|
+
// Drawer auto-opens via CartDrawerProvider's openOnAdd watcher.
|
|
47
|
+
await expect(page.getByRole("dialog", { name: /cart/i })).toBeVisible();
|
|
48
|
+
await expect(page).toHaveScreenshot("cart-drawer.png", {
|
|
49
|
+
mask: [page.locator("img")],
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -15,15 +15,18 @@
|
|
|
15
15
|
"check:brand": "vitest run __tests__/brand.test.ts",
|
|
16
16
|
"check:cart": "vitest run __tests__/cart-flow.test.ts",
|
|
17
17
|
"check:contract": "vitest run __tests__/contract.test.ts",
|
|
18
|
+
"check:visual": "playwright test",
|
|
19
|
+
"check:visual:update": "playwright test --update-snapshots",
|
|
18
20
|
"check": "bun run typecheck && bun run lint && bun run test:run"
|
|
19
21
|
},
|
|
20
22
|
"dependencies": {
|
|
21
|
-
"@cimplify/sdk": "^0.44.
|
|
23
|
+
"@cimplify/sdk": "^0.44.19",
|
|
22
24
|
"next": "^16.2.4",
|
|
23
25
|
"react": "^19.0.0",
|
|
24
26
|
"react-dom": "^19.0.0"
|
|
25
27
|
},
|
|
26
28
|
"devDependencies": {
|
|
29
|
+
"@playwright/test": "^1.50.0",
|
|
27
30
|
"@tailwindcss/postcss": "^4.2.4",
|
|
28
31
|
"@types/node": "^22.10.0",
|
|
29
32
|
"@types/react": "^19.0.0",
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineConfig, devices } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Visual regression config — boots `bun dev` (mock + next), runs against
|
|
5
|
+
* a stable Chromium, snapshots key pages.
|
|
6
|
+
*
|
|
7
|
+
* Run:
|
|
8
|
+
* bun run check:visual # compare against baseline
|
|
9
|
+
* bun run check:visual --update-snapshots # accept new baseline
|
|
10
|
+
*
|
|
11
|
+
* Baselines live in `e2e/__snapshots__/`. Commit them.
|
|
12
|
+
*/
|
|
13
|
+
export default defineConfig({
|
|
14
|
+
testDir: "./e2e",
|
|
15
|
+
fullyParallel: false,
|
|
16
|
+
forbidOnly: Boolean(process.env.CI),
|
|
17
|
+
retries: process.env.CI ? 1 : 0,
|
|
18
|
+
workers: 1,
|
|
19
|
+
reporter: process.env.CI ? "github" : "list",
|
|
20
|
+
|
|
21
|
+
use: {
|
|
22
|
+
baseURL: "http://localhost:3000",
|
|
23
|
+
trace: "retain-on-failure",
|
|
24
|
+
// Viewport snapshots are noisy across OS / browser builds. Lock here.
|
|
25
|
+
viewport: { width: 1280, height: 800 },
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
projects: [
|
|
29
|
+
{
|
|
30
|
+
name: "chromium",
|
|
31
|
+
use: { ...devices["Desktop Chrome"], viewport: { width: 1280, height: 800 } },
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
|
|
35
|
+
expect: {
|
|
36
|
+
// Anti-flake: allow tiny rendering differences (font hinting across runners).
|
|
37
|
+
toHaveScreenshot: { maxDiffPixelRatio: 0.01 },
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
webServer: {
|
|
41
|
+
command: "bun dev",
|
|
42
|
+
url: "http://localhost:3000",
|
|
43
|
+
reuseExistingServer: !process.env.CI,
|
|
44
|
+
timeout: 120_000,
|
|
45
|
+
stdout: "ignore",
|
|
46
|
+
stderr: "pipe",
|
|
47
|
+
},
|
|
48
|
+
});
|