Files
payload/test/refresh-permissions/e2e.spec.ts
Alessio Gravili 9467074fb9 chore: update 2.0 branch from master (#3207)
Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
Co-authored-by: Alessio Gravili <alessio@gravili.de>
Co-authored-by: PatrikKozak <patrik@trbl.design>
Co-authored-by: Lucas Blancas <lablancas@gmail.com>
Co-authored-by: Stef Gootzen <37367280+stefgootzen@users.noreply.github.com>
Co-authored-by: Jarrod Flesch <30633324+JarrodMFlesch@users.noreply.github.com>
Co-authored-by: Jessica Chowdhury <67977755+JessChowdhury@users.noreply.github.com>
Co-authored-by: PatrikKozak <35232443+PatrikKozak@users.noreply.github.com>
Co-authored-by: Greg Willard <Wickett06@gmail.com>
Co-authored-by: James Mikrut <james@payloadcms.com>
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
fix: WhereBuilder component does not accept all valid Where queries (#3087)
fix: passes in height to resizeOptions upload option to allow height resize (#3171)
2023-08-22 16:04:50 -04:00

34 lines
1.1 KiB
TypeScript

import { expect, Page, test } from '@playwright/test';
import { initPayloadE2E } from '../helpers/configHelpers';
const { beforeAll, describe } = test;
describe('refresh-permissions', () => {
let serverURL: string;
let page: Page;
beforeAll(async ({ browser }) => {
({ serverURL } = await initPayloadE2E(__dirname));
const context = await browser.newContext();
page = await context.newPage();
});
test('should show test global immediately after allowing access', async () => {
await page.goto(`${serverURL}/admin/globals/settings`);
// Ensure that we have loaded accesses by checking that settings collection
// at least is visible in the menu.
await expect(page.locator('#nav-global-settings')).toBeVisible();
// Test collection should be hidden at first.
await expect(page.locator('#nav-global-test')).toBeHidden();
// Allow access to test global.
await page.locator('.custom-checkbox:has(#field-test) input').check();
await page.locator('#action-save').click();
// Now test collection should appear in the menu.
await expect(page.locator('#nav-global-test')).toBeVisible();
});
});