make OrganizationPolicy use “organizations:update” to remove jetstream inconsistencies

The frontend did not show organization settings for admin users because of the team ownership check
This commit is contained in:
Gregor Vostrak
2026-02-17 14:35:52 +01:00
parent f1d001e03e
commit 435522b502
4 changed files with 128 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ import { test as baseTest } from '@playwright/test';
import type { Page } from '@playwright/test';
import { PLAYWRIGHT_BASE_URL, TEST_USER_PASSWORD } from './config';
import { type TestContext, setupTestContext } from '../e2e/utils/api';
import { setupEmployeeUser } from '../e2e/utils/members';
import { setupAdminUser, setupEmployeeUser } from '../e2e/utils/members';
export * from '@playwright/test';
export type { TestContext };
@@ -12,6 +12,11 @@ export interface EmployeeFixture {
memberId: string;
}
export interface AdminFixture {
page: Page;
memberId: string;
}
/**
* API-based authentication fixture - creates a new user via HTTP requests instead of UI interactions.
* This is ~10-25x faster than UI-based authentication (~100-200ms vs ~3-5s).
@@ -19,7 +24,7 @@ export interface EmployeeFixture {
* Uses page.context().request() to ensure cookies are shared between the API request and page.
*/
export const test = baseTest.extend<
{ ctx: TestContext; employee: EmployeeFixture },
{ ctx: TestContext; employee: EmployeeFixture; admin: AdminFixture },
{ workerStorageState: string }
>({
page: async ({ page }, use) => {
@@ -100,4 +105,10 @@ export const test = baseTest.extend<
await use({ page: employeePage, memberId: employeeMemberId });
await closeEmployee();
},
admin: async ({ page, ctx, browser }, use) => {
const { adminPage, adminMemberId, closeAdmin } = await setupAdminUser(page, ctx, browser);
await use({ page: adminPage, memberId: adminMemberId });
await closeAdmin();
},
});