diff --git a/server/commands/teamCreator.test.ts b/server/commands/teamCreator.test.ts index e57f71748..a6aba15f2 100644 --- a/server/commands/teamCreator.test.ts +++ b/server/commands/teamCreator.test.ts @@ -73,6 +73,23 @@ describe("teamCreator", () => { }); describe("self hosted", () => { + it("should allow creating first team", async () => { + env.DEPLOYMENT = undefined; + const { team, isNewTeam } = await teamCreator({ + name: "Test team", + subdomain: "example", + avatarUrl: "http://example.com/logo.png", + authenticationProvider: { + name: "google", + providerId: "example.com", + }, + ip, + }); + + expect(isNewTeam).toBeTruthy(); + expect(team.name).toEqual("Test team"); + }); + it("should not allow creating multiple teams in installation", async () => { env.DEPLOYMENT = undefined; await buildTeam(); diff --git a/server/commands/teamCreator.ts b/server/commands/teamCreator.ts index 7d43f146a..210a09a26 100644 --- a/server/commands/teamCreator.ts +++ b/server/commands/teamCreator.ts @@ -91,7 +91,9 @@ async function teamCreator({ } } - throw MaximumTeamsError(); + if (team) { + throw MaximumTeamsError(); + } } // If the service did not provide a logo/avatar then we attempt to generate