feat(site-builder): pre-publish checklist and canonical link
Publish now runs client-side checks (image alt, meta description, title length, H1, empty links, contrast, noindex landing, empty page) over the current state and shows a grouped checklist with Fix links and "Publish anyway". Adds ExportOptions.canonicalUrl -> <link rel="canonical"> after the favicon line in both Preview and export. Refs #54
This commit is contained in:
1 parent
5430f13877
commit
c0fd183c11
12 files changed
+913
-13
No files matched your search
@@ -138,7 +138,7 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
const edit = () => act(() => { guard.markDirty(); });
|
||||
const clickPublish = async () => { await act(async () => { q('button[aria-label="Publish to live site"]')!.click(); }); await flush(); };
|
||||
const clickPublish = async () => { await act(async () => { q('button[aria-label="Publish to live site"]')!.click(); }); await confirmChecklist(); await flush(); };
|
||||
|
||||
describe('saves are serialised', () => {
|
||||
test('a save requested during an in-flight publish waits, then saves with the rev the first save returned', async () => {
|
||||
@@ -235,3 +235,10 @@ describe('autosave timer', () => {
|
||||
expect(calls('save').length).toBeGreaterThanOrEqual(2);
|
||||
});
|
||||
});
|
||||
|
||||
/** #54: the pre-publish checklist opens for these fixtures (an empty Home with no
|
||||
* meta description); these tests are about the publish path, so confirm it. */
|
||||
async function confirmChecklist() {
|
||||
const b = q('[data-testid="publish-checklist-confirm"]') as HTMLElement | null;
|
||||
if (b) await act(async () => { b.click(); });
|
||||
}
|
||||
Reference in new issue
Block a user