PluginProbe
Extendify / 3.1.0
Extendify v3.1.0
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / tests / playwright / Library / auto-open.spec.ts

auto-open.spec.ts in Extendify 3.1.0, at tests/playwright/Library/auto-open.spec.ts

39 lines 964 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { expect, test } from '../fixtures';
2
3 const categoriesStub = [
4 { id: 8, slug: 'hero', name: 'Hero' },
5 { id: 6, slug: 'content', name: 'Content' },
6 ];
7
8 const patternsStub = [
9 {
10 id: '1-stub-hero',
11 slug: 'stub-hero',
12 name: 'Stub Hero',
13 code: '<!-- wp:paragraph --><p>Stub pattern</p><!-- /wp:paragraph -->',
14 categories: ['hero'],
15 },
16 ];
17
18 test.beforeEach(async ({ page, requestUtils }) => {
19 await requestUtils.login();
20
21 await page.route(/\/api\/categories/, (route) =>
22 route.fulfill({ status: 200, json: categoriesStub }),
23 );
24 await page.route(/\/api\/patterns/, (route) =>
25 route.fulfill({ status: 200, json: patternsStub }),
26 );
27 });
28
29 test('Library modal auto-loads when a partner id is set', async ({
30 admin,
31 page,
32 }) => {
33 await admin.visitAdminPage('post-new.php', 'post_type=post');
34 await expect(page.locator('.extendify-library-modal')).toBeVisible({
35 timeout: 15_000,
36 });
37 await page.getByTestId('modal-close-button').click();
38 });
39