fix: Cannot create new team on self-hosted (#3819)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user