forked from baron/baron-sso
custom claim 권한체크 확인
This commit is contained in:
@@ -182,6 +182,52 @@ async function waitForTextContent(container: HTMLElement, text: string) {
|
||||
}
|
||||
|
||||
describe("ClientsPage", () => {
|
||||
it("does not show the legacy tenant scope label for unrestricted clients", async () => {
|
||||
fetchClientsMock.mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
...makeClients(1)[0],
|
||||
name: "Unrestricted App",
|
||||
metadata: {
|
||||
tenant_access_restricted: false,
|
||||
allowed_tenants: [],
|
||||
},
|
||||
},
|
||||
],
|
||||
limit: 100,
|
||||
offset: 0,
|
||||
});
|
||||
|
||||
const container = await renderPage();
|
||||
|
||||
expect(container.textContent).toContain("Unrestricted App");
|
||||
expect(container.textContent).not.toContain("Tenant-scoped");
|
||||
expect(container.textContent).not.toContain("Tenant-limited");
|
||||
});
|
||||
|
||||
it("shows Tenant-limited only when client tenant access is restricted", async () => {
|
||||
fetchClientsMock.mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
...makeClients(1)[0],
|
||||
name: "Limited App",
|
||||
metadata: {
|
||||
tenant_access_restricted: true,
|
||||
allowed_tenants: ["tenant-1"],
|
||||
},
|
||||
},
|
||||
],
|
||||
limit: 100,
|
||||
offset: 0,
|
||||
});
|
||||
|
||||
const container = await renderPage();
|
||||
|
||||
expect(container.textContent).toContain("Limited App");
|
||||
expect(container.textContent).toContain("Tenant-limited");
|
||||
expect(container.textContent).not.toContain("Tenant-scoped");
|
||||
});
|
||||
|
||||
it("expands the list and applies search filters", async () => {
|
||||
fetchClientsMock.mockResolvedValue({
|
||||
items: makeClients(6),
|
||||
|
||||
Reference in New Issue
Block a user