Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
mustard-mh committed Nov 22, 2023
1 parent 75cd32a commit e9df853
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/server/src/workspace/context-service.spec.db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { ConfigProvider } from "./config-provider";
import { PrebuildManager } from "../prebuilds/prebuild-manager";
import { HostContextProvider } from "../auth/host-context-provider";
import { AuthProvider } from "../auth/auth-provider";
import { Experiments } from "@gitpod/gitpod-protocol/lib/experiments/configcat-server";

const expect = chai.expect;

Expand Down Expand Up @@ -64,6 +65,7 @@ describe("ContextService", async () => {
let member: User;
let stranger: User;
let org: Organization;
let org2: Organization;
let project: Project;
let workspace: ProtocolWorkspace;
let snapshot: Snapshot;
Expand All @@ -72,6 +74,9 @@ describe("ContextService", async () => {

beforeEach(async () => {
container = createTestContainer();
Experiments.configureTestingClient({
centralizedPermissions: true,
});
container.rebind(ConfigProvider).toConstantValue({
fetchConfig: () => {
return {
Expand Down Expand Up @@ -222,6 +227,7 @@ describe("ContextService", async () => {
authProviderId: "Public-GitHub",
},
});
org2 = await orgService.createOrganization(stranger.id, "stranger-org");

// create a workspace
const workspaceService = container.get(WorkspaceService);
Expand All @@ -236,7 +242,7 @@ describe("ContextService", async () => {
prebuild = await prebuildManager.triggerPrebuild({}, owner, project.id, "main");

// create a workspace and snapshot for another user
const anotherWorkspace = await createTestWorkspace(workspaceService, org, stranger, project);
const anotherWorkspace = await createTestWorkspace(workspaceService, org2, stranger, project);
snapshot_stranger = await snapshotService.createSnapshot(
{ workspaceId: anotherWorkspace.id },
SNAPSHOT_BUCKET,
Expand Down

0 comments on commit e9df853

Please sign in to comment.