feat(admin): streamline group management
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { AdminUserTable } from "./admin-user-table";
|
||||
|
||||
describe("AdminUserTable", () => {
|
||||
it("renders reusable identity and confirmed group controls", () => {
|
||||
const markup = renderToStaticMarkup(<AdminUserTable
|
||||
action={async () => undefined}
|
||||
assignmentByUser={{ user1: "ops" }}
|
||||
emptyMessage="No members."
|
||||
groups={[{ id: "everyone", name: "everyone", isDefault: true }, { id: "ops", name: "Ops", isDefault: false }]}
|
||||
returnTo="/admin/groups/11111111-1111-4111-8111-111111111111"
|
||||
users={[{
|
||||
id: "user1",
|
||||
firstName: "Alex",
|
||||
discordUsername: "alex",
|
||||
discordGlobalName: "Alex Global",
|
||||
discordUserId: "123",
|
||||
onboardingCompletedAt: new Date("2026-08-01T00:00:00Z"),
|
||||
primaryUsername: "AlexMC",
|
||||
accountCount: 2,
|
||||
}]}
|
||||
/>);
|
||||
expect(markup).toContain("Alex Global");
|
||||
expect(markup).toContain("AlexMC");
|
||||
expect(markup).toContain("Accounts");
|
||||
expect(markup).toContain("Group for Alex");
|
||||
expect(markup).toContain("Confirm move");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user