feat(portal): add service drawers and employee portal preview

This commit is contained in:
DeCentN2Madness committed 2026-10-30 00:03:21 -07:00
1 parent ff80ee516f
commit e97f0ea9b4
39 files changed
+1446 -130

No files matched your search

+4 -3
View File
@@ -65,6 +65,7 @@ try {
viewport: { width, height: width < 500 ? 844 : 960 },
serviceWorkers: 'block',
});
await context.addInitScript(() => localStorage.setItem('aia:service-inquiry:auto-suppressed-until', String(Date.now() + 86400000)));
await context.routeWebSocket('**/*', (socket) => socket.close());
await context.route('**/*', async (route) => {
const request = route.request();
@@ -103,7 +104,7 @@ try {
const attemptsBefore = evidence.jotformAttempts.length;
if (expected.drawer) {
const opener = page.locator('[data-service-inquiry-open]');
const opener = page.locator('[data-service-inquiry-trigger]');
assert.equal(await opener.count(), 1, expected.route);
assert.equal(await iframe.getAttribute('src'), null, expected.route + ' must defer the iframe source');
assert.equal(await iframe.getAttribute('data-jotform-iframe-url'), url, expected.route);
@@ -121,7 +122,7 @@ try {
await page.keyboard.press('Escape');
await page.waitForFunction(() => !document.querySelector('[data-service-inquiry-drawer]')?.open);
assert.equal(await page.evaluate(() => document.activeElement?.getAttribute('data-service-inquiry-open')), '', expected.route + ' restores focus');
assert.equal(await page.evaluate(() => document.activeElement?.getAttribute('data-service-inquiry-trigger')), expected.route.split('/').at(-1), expected.route + ' restores focus');
await opener.click();
await page.waitForTimeout(20);
assert.equal(await page.locator('[data-jotform-form-a] iframe').count(), 1, expected.route + ' must retain one iframe');
@@ -193,7 +194,7 @@ try {
window.setTimeout = (callback, timeout, ...args) => original(callback, timeout === 15000 ? 80 : timeout, ...args);
});
await fallbackPage.goto(origin + '/aba-therapy', { waitUntil: 'domcontentloaded', timeout: 15000 });
await fallbackPage.locator('[data-service-inquiry-open]').click();
await fallbackPage.locator('[data-service-inquiry-trigger]').click();
const fallback = fallbackPage.locator('[data-jotform-iframe-fallback]');
await fallbackPage.waitForFunction(() => document.querySelector('[data-jotform-iframe-fallback]')?.hidden === false);
assert.equal(await fallback.isVisible(), true, 'blocked drawer request exposes the hosted fallback after timeout');