jojo/tests/e2e/org-members.test.e2e.ts
0ko a0faae2764 fix(ui/mde): inputs in table/link insertion modals (#11341)
Fixes #11268
Fixes regression of #9614

Calling `initDisabledInputs` wasn't effective for template contents, so inputs in MDEs spawned by repo-legacy.js on comment editing were broken. Now repo-legacy.js also calls it when it spawns a new MDE.

Co-authored-by: Gusted <Gusted@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11341
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2026-03-02 23:32:40 +01:00

51 lines
1.6 KiB
TypeScript

// Copyright 2026 The Forgejo Authors
// SPDX-License-Identifier: GPL-3.0-or-later
// @watch start
// web_src/css/org.css
// templates/org/member/members.tmpl
// @watch end
import {expect} from '@playwright/test';
import {test} from './utils_e2e.ts';
test.use({user: 'user2'});
test('Toggle visibility', async ({page}) => {
page.goto('/org/org3/members');
// Button "Make hidden" for user2's row
const hideUser2 = page.locator('.link-action[data-url="/org/org3/members/action/private?uid=2"]');
// Button "Make visible" for user2's row
const showUser2 = page.locator('.link-action[data-url="/org/org3/members/action/public?uid=2"]');
await expect(hideUser2).toBeVisible();
await expect(showUser2).toBeHidden();
await hideUser2.click();
// Button action was flipped
await expect(hideUser2).toBeHidden();
await expect(showUser2).toBeVisible();
// Revert for repeatability
await showUser2.click();
});
test('Leave org', async ({page}) => {
page.goto('/org/org3/members');
// Button "Leave" for user2's row
const leaveButton = page.locator('.delete-button[data-url="/org/org3/members/action/leave"]');
// Click the button
await leaveButton.click();
// A confirmation modal will appear
await expect(page.locator('.modal#leave-organization')).toBeVisible();
// Proceed leaving the org
await page.locator('.modal#leave-organization .actions button.ok').click();
// Getting error is enough to know that the correct request went though
await expect(page.locator('.flash-error').getByText('You cannot remove the last user from the "owners" team.')).toBeVisible();
});