chore: Remove DEPLOYMENT and SUBDOMAINS_ENABLED (#5742)

This commit is contained in:
Tom Moor
2023-08-28 20:39:58 -04:00
committed by GitHub
parent 7725f29dc7
commit 30a4303a8e
35 changed files with 136 additions and 135 deletions

View File

@@ -1,11 +1,16 @@
import env from "@server/env";
import { buildUser, buildTeam, buildAdmin } from "@server/test/factories";
import { setupTestDatabase } from "@server/test/support";
import {
setCloudHosted,
setSelfHosted,
setupTestDatabase,
} from "@server/test/support";
import { serialize } from "./index";
setupTestDatabase();
it("should allow reading only", async () => {
setSelfHosted();
const team = await buildTeam();
const user = await buildUser({
teamId: team.id,
@@ -21,6 +26,8 @@ it("should allow reading only", async () => {
});
it("should allow admins to manage", async () => {
setSelfHosted();
const team = await buildTeam();
const admin = await buildAdmin({
teamId: team.id,
@@ -36,7 +43,7 @@ it("should allow admins to manage", async () => {
});
it("should allow creation on hosted envs", async () => {
env.DEPLOYMENT = "hosted";
setCloudHosted();
const team = await buildTeam();
const admin = await buildAdmin({

View File

@@ -13,7 +13,7 @@ allow(User, "share", Team, (user, team) => {
});
allow(User, "createTeam", Team, () => {
if (!env.isCloudHosted()) {
if (!env.isCloudHosted) {
throw IncorrectEditionError("Functionality is only available on cloud");
}
return true;
@@ -27,7 +27,7 @@ allow(User, "update", Team, (user, team) => {
});
allow(User, ["delete", "audit"], Team, (user, team) => {
if (!env.isCloudHosted()) {
if (!env.isCloudHosted) {
throw IncorrectEditionError("Functionality is only available on cloud");
}
if (!team || user.isViewer || user.teamId !== team.id) {