All files / realm/blong-party/test portal.play.ts

100% Statements 39/39
100% Branches 3/3
100% Functions 0/0
100% Lines 39/39

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 401x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
/**
 * Portal navigation — tests the login, menu structure, and tab management for party realm.
 *
 * Tab screenshots use a search filter to show only seed data, ensuring
 * they remain stable regardless of test execution order (other tests may
 * have created records before these run).
 */
import {expect, test} from '@feasibleone/blong-browser/playwright';
 
test.use({blongPermissions: true});
 
test('portal loads after login', async ({portal}) => {
    await expect(portal.page.locator('.blong-portal-menubar')).toBeVisible();
    await portal.page.getByTestId('portal-menu-party').click();
    await expect(portal.page).toHaveScreenshot('portal-home.png');
});
 
test('open and close person browse tab', async ({portal}) => {
    await portal.menuClick('party.person.browse');
    // Filter first: the unfiltered person list is large (guest registrations
    // accumulate) and waiting for the whole page can exceed the element timeout,
    // while the filtered table is what the screenshot shows anyway.
    const search = portal.page.getByTestId('browse-search');
    await search.waitFor({state: 'visible'});
    await search.fill('John');
    await portal.page.waitForTimeout(500);
    await portal.waitForTableData();
    await expect(portal.page).toHaveScreenshot('portal-person-tab.png');
});
 
test('open and close organization browse tab', async ({portal}) => {
    await portal.menuClick('party.organization.browse');
    await portal.waitForTableData();
    // Filter to seed data only — screenshots must be stable across runs
    await portal.page.getByTestId('browse-search').fill('Global Bank');
    await portal.page.waitForTimeout(500);
    await portal.waitForTableData();
    await expect(portal.page).toHaveScreenshot('portal-organization-tab.png');
});