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 / AutoLaunch / b-mobile-scroll.spec.ts

b-mobile-scroll.spec.ts in Extendify 3.1.1, at tests/playwright/AutoLaunch/b-mobile-scroll.spec.ts

53 lines 1.5 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 // ShowTitle:B adds a site-title field and SubmitOutside:B pushes the submit
4 // button below the description, together making the page taller than the
5 // control. Make sure the "WP Admin Dashboard" exit link is reachable.
6 // Regression for company-product#2257.
7
8 const SHORT_MOBILE = { width: 360, height: 640 };
9
10 const forceVariantB = (page) =>
11 page.addInitScript(() => {
12 let ext: unknown;
13 Object.defineProperty(window, 'extLaunchData', {
14 configurable: true,
15 get: () => ext,
16 set: (value) => {
17 const data = value as {
18 activeTests?: Record<string, { variant: string }>;
19 } | null;
20 if (data && typeof data === 'object') {
21 data.activeTests = {
22 ...data.activeTests,
23 'AutoLaunch.ShowTitle': { variant: 'B' },
24 'AutoLaunch.SubmitOutside': { variant: 'B' },
25 };
26 }
27 ext = value;
28 },
29 });
30 });
31
32 test.beforeEach(async ({ requestUtils }) => {
33 await requestUtils.login();
34 });
35
36 test('B variant scrolls on a short mobile viewport and the exit link is reachable', async ({
37 page,
38 admin,
39 }) => {
40 await forceVariantB(page);
41 await page.setViewportSize(SHORT_MOBILE);
42 await admin.visitAdminPage('admin.php', 'page=extendify-auto-launch');
43
44 const exitLink = page.getByRole('link', { name: 'WP Admin Dashboard' });
45 await expect(exitLink).toBeAttached();
46
47 const scroller = page.locator('div.overflow-y-auto');
48 await expect(scroller).toHaveCSS('overflow-y', 'auto');
49
50 await exitLink.scrollIntoViewIfNeeded();
51 await expect(exitLink).toBeVisible();
52 });
53