HEX
Server: LiteSpeed
System: Linux server342.web-hosting.com 4.18.0-553.124.4.lve.el8.x86_64 #1 SMP Fri May 15 13:02:13 UTC 2026 x86_64
User: ksonpoau (1099)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //home/ksonpoau/www/wp-content/plugins/extendify/tests/playwright/Library/auto-open.spec.ts
import { expect, test } from '../fixtures';

const categoriesStub = [
	{ id: 8, slug: 'hero', name: 'Hero' },
	{ id: 6, slug: 'content', name: 'Content' },
];

const patternsStub = [
	{
		id: '1-stub-hero',
		slug: 'stub-hero',
		name: 'Stub Hero',
		code: '<!-- wp:paragraph --><p>Stub pattern</p><!-- /wp:paragraph -->',
		categories: ['hero'],
	},
];

test.beforeEach(async ({ page, requestUtils }) => {
	await requestUtils.login();

	await page.route(/\/api\/categories/, (route) =>
		route.fulfill({ status: 200, json: categoriesStub }),
	);
	await page.route(/\/api\/patterns/, (route) =>
		route.fulfill({ status: 200, json: patternsStub }),
	);
});

test('Library modal auto-loads when a partner id is set', async ({
	admin,
	page,
}) => {
	await admin.visitAdminPage('post-new.php', 'post_type=post');
	await expect(page.locator('.extendify-library-modal')).toBeVisible({
		timeout: 15_000,
	});
	await page.getByTestId('modal-close-button').click();
});