Add templates, tests, and miscellaneous project files
Includes new page templates (fitness-gym, nonprofit, online-course, photography-studio, real-estate, startup-company, travel-blog, wedding-invitation) with thumbnail SVGs, test specs, documentation files, and minor updates to index.html, router.php, and playwright config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
38
tests/media-blocks-simple.spec.js
Normal file
38
tests/media-blocks-simple.spec.js
Normal file
@@ -0,0 +1,38 @@
|
||||
const { test, expect } = require('@playwright/test');
|
||||
const { waitForEditor, addBlockById } = require('./helpers');
|
||||
|
||||
test('Media category should have 3 blocks: Image, Video, File/PDF', async ({ page }) => {
|
||||
await waitForEditor(page);
|
||||
|
||||
// Verify all 3 media blocks are registered
|
||||
const mediaBlocks = await page.evaluate(() => {
|
||||
const editor = window.editor;
|
||||
const bm = editor.BlockManager;
|
||||
return {
|
||||
image: !!bm.get('image-block'),
|
||||
video: !!bm.get('video-block'),
|
||||
fileEmbed: !!bm.get('file-embed'),
|
||||
};
|
||||
});
|
||||
|
||||
expect(mediaBlocks.image).toBe(true);
|
||||
expect(mediaBlocks.video).toBe(true);
|
||||
expect(mediaBlocks.fileEmbed).toBe(true);
|
||||
|
||||
// Verify they are in the Media category
|
||||
const categories = await page.evaluate(() => {
|
||||
const editor = window.editor;
|
||||
const bm = editor.BlockManager;
|
||||
return ['image-block', 'video-block', 'file-embed'].map(id => {
|
||||
const block = bm.get(id);
|
||||
const cat = block.get('category');
|
||||
return { id, category: typeof cat === 'string' ? cat : (cat && cat.id) };
|
||||
});
|
||||
});
|
||||
|
||||
for (const block of categories) {
|
||||
expect(block.category).toBe('Media');
|
||||
}
|
||||
|
||||
console.log('All 3 Media blocks verified: Image, Video, File/PDF');
|
||||
});
|
||||
Reference in New Issue
Block a user