refactor: remove New OAuth client button from admin page (#27181)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Lauris SkraucisandDevin AI authored and GitHub committed 2026-01-26 09:34:58 +01:00
1 parent 6a532c2271
commit f5d79a1470
3 files changed
+28 -97

No files matched your search

@@ -3,7 +3,6 @@ import { expect, type Page } from "@playwright/test";
import { test } from "../lib/fixtures";
import {
closeOAuthClientDetails,
createApprovedOAuthClientAsAdmin,
createPendingOAuthClient,
openOAuthClientDetailsFromList,
goToAdminOAuthSettings
@@ -155,14 +154,5 @@ test.describe("OAuth clients admin", () => {
await expectClientInAdminSection(page, "oauth-client-admin-approved-section", toBeApproved.clientId);
await expectClientInAdminSection(page, "oauth-client-admin-rejected-section", toBeRejected.clientId);
await expectClientInAdminSection(page, "oauth-client-admin-pending-section", staysPending.clientId);
// Admin can create an approved client from admin page
const adminCreatedName = `${testPrefix}admin-created-${Date.now()}`;
const adminCreated = await createApprovedOAuthClientAsAdmin(page, makeClientInput(adminCreatedName));
await expectClientStatusInDb(prisma, adminCreated.clientId, "APPROVED");
// Should now be in approved list
await expect(page.getByTestId(`oauth-client-list-item-${adminCreated.clientId}`)).toBeVisible();
});
});
@@ -68,41 +68,6 @@ export async function createPendingOAuthClient(page: Page, input: CreateOAuthCli
return { clientId, clientSecret };
}
export async function createApprovedOAuthClientAsAdmin(
page: Page,
input: CreateOAuthClientInput
): Promise<CreateOAuthClientResult> {
await goToAdminOAuthSettings(page);
await page.getByTestId("open-admin-oauth-client-create-dialog").click();
const form = page.getByTestId("oauth-client-create-form");
await form.locator("#name").fill(input.name);
await form.locator("#purpose").fill(input.purpose);
await form.locator("#redirectUri").fill(input.redirectUri);
await form.locator("#websiteUrl").fill(input.websiteUrl);
await uploadOAuthClientLogo(page, input.logoFileName);
const pkceToggle = page.getByTestId("oauth-client-pkce-toggle");
await expect(pkceToggle).toHaveAttribute("data-state", "unchecked");
await page.getByTestId("oauth-client-create-submit").click();
const submitted = page.getByTestId("oauth-client-submitted-modal");
await expect(submitted).toBeVisible();
const clientId = ((await page.getByTestId("oauth-client-submitted-client-id").textContent()) ?? "").trim();
expect(clientId.length).toBeGreaterThan(1);
const clientSecret = ((await page.getByTestId("oauth-client-submitted-client-secret").textContent()) ?? "").trim();
expect(clientSecret.length).toBeGreaterThan(1);
await page.getByTestId("oauth-client-submitted-done").click();
return { clientId, clientSecret };
}
export async function openOAuthClientDetailsFromList(page: Page, clientId: string): Promise<Locator> {
const details = page.getByTestId("oauth-client-details-form");
await page.getByTestId(`oauth-client-list-item-${clientId}`).click();