fix: Incorrect calculation of subdomain when previously used more than once
This commit is contained in:
@@ -11,7 +11,7 @@ it("should set subdomain if available", async () => {
|
||||
expect(team.subdomain).toEqual("testy");
|
||||
});
|
||||
|
||||
it("should set subdomain with append if unavailable", async () => {
|
||||
it("should set subdomain append if unavailable", async () => {
|
||||
await buildTeam({ subdomain: "myteam" });
|
||||
|
||||
const team = await buildTeam();
|
||||
@@ -20,6 +20,16 @@ it("should set subdomain with append if unavailable", async () => {
|
||||
expect(team.subdomain).toEqual("myteam1");
|
||||
});
|
||||
|
||||
it("should increment subdomain append if unavailable", async () => {
|
||||
await buildTeam({ subdomain: "myteam" });
|
||||
await buildTeam({ subdomain: "myteam1" });
|
||||
|
||||
const team = await buildTeam();
|
||||
const subdomain = await team.provisionSubdomain("myteam");
|
||||
expect(subdomain).toEqual("myteam2");
|
||||
expect(team.subdomain).toEqual("myteam2");
|
||||
});
|
||||
|
||||
it("should do nothing if subdomain already set", async () => {
|
||||
const team = await buildTeam({ subdomain: "example" });
|
||||
const subdomain = await team.provisionSubdomain("myteam");
|
||||
|
||||
Reference in New Issue
Block a user