@cmssy/core 10.7.0 → 10.8.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/dist/testing.cjs +6 -5
- package/dist/testing.js +6 -5
- package/package.json +1 -1
package/dist/testing.cjs
CHANGED
|
@@ -144,6 +144,7 @@ async function graphqlRequest(config, query, variables, options = {}, label = "r
|
|
|
144
144
|
// src/testing/edit-smoke.ts
|
|
145
145
|
var EDITOR_MARKER = /data-cmssy-editor/;
|
|
146
146
|
var SERVER_LAYOUT_BLOCKS = /<header|<footer/;
|
|
147
|
+
var EDITABLE_LAYOUT_SLOT = /data-cmssy-layout-slot/;
|
|
147
148
|
async function html(url) {
|
|
148
149
|
const response = await fetch(url, { redirect: "manual" });
|
|
149
150
|
return { status: response.status, body: await response.text() };
|
|
@@ -188,11 +189,6 @@ async function checkCmssyEditMode(options) {
|
|
|
188
189
|
}
|
|
189
190
|
const hasServerLayoutBlocks = SERVER_LAYOUT_BLOCKS.test(publicPage.body);
|
|
190
191
|
const configured = options.workspace ? await workspaceHasLayoutBlocks(options.workspace, path) : null;
|
|
191
|
-
if (configured === true && !hasServerLayoutBlocks) {
|
|
192
|
-
failures.push(
|
|
193
|
-
`public ${path}: the workspace defines layout blocks and the page renders none - is a layout slot mounted? (10.0 removed CmssyLayoutSlot; see docs/wiring.md \xA75)`
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
192
|
const unverified = await html(url(`${path}?cmssyEdit=1`));
|
|
197
193
|
if (EDITOR_MARKER.test(unverified.body)) {
|
|
198
194
|
failures.push(
|
|
@@ -215,6 +211,11 @@ async function checkCmssyEditMode(options) {
|
|
|
215
211
|
`edit ${path}: the header and footer are still server-rendered - the editor will let you select them but show no fields (is CMSSY_EDIT_HEADER set on the rewrite?)`
|
|
216
212
|
);
|
|
217
213
|
}
|
|
214
|
+
if (configured === true && !EDITABLE_LAYOUT_SLOT.test(verified.body)) {
|
|
215
|
+
failures.push(
|
|
216
|
+
`edit ${path}: the workspace defines layout blocks and no editable layout slot is mounted - the header and footer cannot be edited (10.0 removed CmssyLayoutSlot; see docs/wiring.md \xA75)`
|
|
217
|
+
);
|
|
218
|
+
}
|
|
218
219
|
const { localizedPath } = options;
|
|
219
220
|
if (localizedPath) {
|
|
220
221
|
const locale = options.localizedLocale ?? localizedPath.split("/").filter(Boolean)[0];
|
package/dist/testing.js
CHANGED
|
@@ -142,6 +142,7 @@ async function graphqlRequest(config, query, variables, options = {}, label = "r
|
|
|
142
142
|
// src/testing/edit-smoke.ts
|
|
143
143
|
var EDITOR_MARKER = /data-cmssy-editor/;
|
|
144
144
|
var SERVER_LAYOUT_BLOCKS = /<header|<footer/;
|
|
145
|
+
var EDITABLE_LAYOUT_SLOT = /data-cmssy-layout-slot/;
|
|
145
146
|
async function html(url) {
|
|
146
147
|
const response = await fetch(url, { redirect: "manual" });
|
|
147
148
|
return { status: response.status, body: await response.text() };
|
|
@@ -186,11 +187,6 @@ async function checkCmssyEditMode(options) {
|
|
|
186
187
|
}
|
|
187
188
|
const hasServerLayoutBlocks = SERVER_LAYOUT_BLOCKS.test(publicPage.body);
|
|
188
189
|
const configured = options.workspace ? await workspaceHasLayoutBlocks(options.workspace, path) : null;
|
|
189
|
-
if (configured === true && !hasServerLayoutBlocks) {
|
|
190
|
-
failures.push(
|
|
191
|
-
`public ${path}: the workspace defines layout blocks and the page renders none - is a layout slot mounted? (10.0 removed CmssyLayoutSlot; see docs/wiring.md \xA75)`
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
190
|
const unverified = await html(url(`${path}?cmssyEdit=1`));
|
|
195
191
|
if (EDITOR_MARKER.test(unverified.body)) {
|
|
196
192
|
failures.push(
|
|
@@ -213,6 +209,11 @@ async function checkCmssyEditMode(options) {
|
|
|
213
209
|
`edit ${path}: the header and footer are still server-rendered - the editor will let you select them but show no fields (is CMSSY_EDIT_HEADER set on the rewrite?)`
|
|
214
210
|
);
|
|
215
211
|
}
|
|
212
|
+
if (configured === true && !EDITABLE_LAYOUT_SLOT.test(verified.body)) {
|
|
213
|
+
failures.push(
|
|
214
|
+
`edit ${path}: the workspace defines layout blocks and no editable layout slot is mounted - the header and footer cannot be edited (10.0 removed CmssyLayoutSlot; see docs/wiring.md \xA75)`
|
|
215
|
+
);
|
|
216
|
+
}
|
|
216
217
|
const { localizedPath } = options;
|
|
217
218
|
if (localizedPath) {
|
|
218
219
|
const locale = options.localizedLocale ?? localizedPath.split("/").filter(Boolean)[0];
|