chore: org check slug test suite (#3345)

* check slug test

* lint
This commit is contained in:
KinfeMichael Tariku
2025-07-11 09:39:49 -07:00
committed by GitHub
parent 8ac324f64d
commit c3b1ddf5ea
@@ -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({