mirror of
https://github.com/penpot/penpot.git
synced 2025-05-11 23:06:37 +02:00
🐛 Fix admin can demote owner
This commit is contained in:
parent
4d3192546c
commit
bf40cd98e8
4 changed files with 56 additions and 6 deletions
|
@ -0,0 +1,30 @@
|
|||
[
|
||||
{
|
||||
"~:is-admin": true,
|
||||
"~:email": "bar@example.com",
|
||||
"~:team-id": "~udd33ff88-f4e5-8033-8003-8096cc07bdf3",
|
||||
"~:name": "Han Solo",
|
||||
"~:fullname": "Han Solo",
|
||||
"~:is-owner": true,
|
||||
"~:modified-at": "~m1713533116365",
|
||||
"~:can-edit": true,
|
||||
"~:is-active": true,
|
||||
"~:id": "~u1e162163-87b7-805b-8005-5fd05514b6d3",
|
||||
"~:profile-id": "~u1e162163-87b7-805b-8005-5fd05514b6d3",
|
||||
"~:created-at": "~m1733324626956"
|
||||
},
|
||||
{
|
||||
"~:is-admin": true,
|
||||
"~:email": "foo@example.com",
|
||||
"~:team-id": "~udd33ff88-f4e5-8033-8003-8096cc07bdf3",
|
||||
"~:name": "Princesa Leia",
|
||||
"~:fullname": "Princesa Leia",
|
||||
"~:is-owner": false,
|
||||
"~:modified-at": "~m1713533116365",
|
||||
"~:can-edit": true,
|
||||
"~:is-active": true,
|
||||
"~:id": "~uc7ce0794-0992-8105-8004-38e630f29a9b",
|
||||
"~:profile-id": "~uf56647eb-19a7-8115-8003-b6bc939ecd1b",
|
||||
"~:created-at": "~m1713533116365"
|
||||
}
|
||||
]
|
|
@ -35,7 +35,7 @@
|
|||
},
|
||||
"~:permissions": {
|
||||
"~:type": "~:membership",
|
||||
"~:is-owner": true,
|
||||
"~:is-owner": false,
|
||||
"~:is-admin": true,
|
||||
"~:can-edit": true
|
||||
},
|
||||
|
|
|
@ -52,3 +52,20 @@ test("Lists files in the drafts page", async ({ page }) => {
|
|||
dashboardPage.page.getByRole("button", { name: /New File 2/ }),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
test("Bug 9443, Admin can not demote owner", async ({ page }) => {
|
||||
const dashboardPage = new DashboardPage(page);
|
||||
await dashboardPage.setupDashboardFull();
|
||||
await DashboardPage.mockRPC(
|
||||
page,
|
||||
"get-team-members?team-id=*",
|
||||
"dashboard/get-team-members-admin.json",
|
||||
);
|
||||
|
||||
await dashboardPage.goToSecondTeamMembersSection();
|
||||
|
||||
await expect(page.getByRole("heading", { name: "Members" })).toBeVisible();
|
||||
await expect(page.getByRole("combobox", { name: "Admin" })).toBeVisible();
|
||||
await expect(page.getByText("Owner")).toBeVisible();
|
||||
await expect(page.getByRole("combobox", { name: "Owner" })).toHaveCount(0);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue