mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-15 11:42:15 +01:00
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:
@@ -369,6 +369,40 @@ test('test that format settings persist after page reload', async ({ page }) =>
|
||||
await expect(page.getByLabel('Date Format')).toContainText('DD/MM/YYYY');
|
||||
});
|
||||
|
||||
// =============================================
|
||||
// Admin Permission Tests
|
||||
// =============================================
|
||||
|
||||
test.describe('Admin Organization Settings Access', () => {
|
||||
test('admin can see and edit organization settings', async ({ ctx, admin }) => {
|
||||
await admin.page.goto(PLAYWRIGHT_BASE_URL + '/teams/' + ctx.orgId);
|
||||
|
||||
// Organization Name section is visible
|
||||
await expect(
|
||||
admin.page.getByRole('heading', { name: 'Organization Name', level: 3 })
|
||||
).toBeVisible({ timeout: 10000 });
|
||||
|
||||
// Editable settings sections should be visible
|
||||
await expect(
|
||||
admin.page.getByRole('heading', { name: 'Billable Rate', level: 3 })
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
admin.page.getByRole('heading', { name: 'Format Settings', level: 3 })
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
admin.page.getByRole('heading', { name: 'Organization Settings', level: 3 })
|
||||
).toBeVisible();
|
||||
|
||||
// Save buttons should be visible (admin can update)
|
||||
await expect(admin.page.getByRole('button', { name: 'Save' }).first()).toBeVisible();
|
||||
|
||||
// Delete organization should NOT be visible (owner only)
|
||||
await expect(
|
||||
admin.page.getByRole('heading', { name: 'Delete Organization' })
|
||||
).not.toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
// =============================================
|
||||
// Employee Permission Tests
|
||||
// =============================================
|
||||
|
||||
Reference in New Issue
Block a user