mirror of
https://github.com/better-auth/better-auth.git
synced 2026-08-01 10:50:40 -05:00
@@ -73,6 +73,26 @@ describe("organization", async (it) => {
|
||||
organizationId,
|
||||
);
|
||||
});
|
||||
it("should check if organization slug is available", async () => {
|
||||
const { headers } = await signInWithTestUser();
|
||||
|
||||
const unusedSlug = await client.organization.checkSlug({
|
||||
slug: "unused-slug",
|
||||
fetchOptions: {
|
||||
headers,
|
||||
},
|
||||
});
|
||||
expect(unusedSlug.data?.status).toBe(true);
|
||||
|
||||
const existingSlug = await client.organization.checkSlug({
|
||||
slug: "test",
|
||||
fetchOptions: {
|
||||
headers,
|
||||
},
|
||||
});
|
||||
expect(existingSlug.error?.status).toBe(400);
|
||||
expect(existingSlug.error?.message).toBe("slug is taken");
|
||||
});
|
||||
|
||||
it("should create organization directly in the server without cookie", async () => {
|
||||
const session = await client.getSession({
|
||||
|
||||
Reference in New Issue
Block a user