PluginProbe
Extendify / 3.1.1
Extendify v3.1.1
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 / Assist / dashboard.spec.ts

dashboard.spec.ts in Extendify 3.1.1, at tests/playwright/Assist/dashboard.spec.ts

42 lines 1.4 KB
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 test.beforeEach(async ({ requestUtils }) => {
4 await requestUtils.login();
5 });
6
7 test('Assist dashboard makes a single router-data POST and no data GETs on load', async ({
8 admin,
9 page,
10 }) => {
11 const requests: { url: string; method: string }[] = [];
12 page.on('request', (req) => {
13 const url = req.url();
14 if (url.includes('/extendify/v1/assist')) {
15 requests.push({ url, method: req.method() });
16 }
17 });
18
19 await admin.visitAdminPage('admin.php', 'page=extendify-assist');
20 await expect(page.getByTestId('assist-landing')).toBeVisible({
21 timeout: 15_000,
22 });
23 await page.waitForLoadState('networkidle');
24
25 const matches = (path: string, method: string) =>
26 requests.filter((r) => r.url.includes(path) && r.method === method);
27
28 expect(matches('assist/task-data', 'GET')).toHaveLength(0);
29 expect(matches('assist/router-data', 'GET')).toHaveLength(0);
30 expect(matches('assist/global-data', 'GET')).toHaveLength(0);
31 expect(matches('assist/recommendation-data', 'GET')).toHaveLength(0);
32 expect(matches('assist/dependency-completed', 'GET')).toHaveLength(0);
33
34 expect(matches('assist/global-data', 'POST')).toHaveLength(0);
35 expect(matches('assist/delete-domains-recommendations', 'POST')).toHaveLength(
36 0,
37 );
38 expect(matches('assist/recommendation-data', 'POST')).toHaveLength(0);
39
40 expect(matches('assist/router-data', 'POST')).toHaveLength(1);
41 });
42