fix: Cannot create new team on self-hosted (#3819)

This commit is contained in:
Tom Moor authored and GitHub committed 2022-07-20 13:18:21 -07:00
1 parent 031a7d396f
commit ef0412c449
2 files changed
+20 -1

No files matched your search

+17
View File
@@ -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();
+3 -1
View File
@@ -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