Skip to content

Commit 9ef3da7

Browse files
committed
fixup! fix: show org summary page if not entitled
1 parent 8b74b12 commit 9ef3da7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

site/src/pages/ManagementSettingsPage/OrganizationSettingsPage.test.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { screen, within } from "@testing-library/react";
22
import { http, HttpResponse } from "msw";
33
import {
44
MockDefaultOrganization,
5+
MockEntitlementsWithMultiOrg,
56
MockOrganization2,
67
} from "testHelpers/entities";
78
import {
@@ -24,6 +25,9 @@ const renderPage = async () => {
2425
describe("OrganizationSettingsPage", () => {
2526
it("has no editable organizations", async () => {
2627
server.use(
28+
http.get("/api/v2/entitlements", () => {
29+
return HttpResponse.json(MockEntitlementsWithMultiOrg);
30+
}),
2731
http.get("/api/v2/organizations", () => {
2832
return HttpResponse.json([MockDefaultOrganization, MockOrganization2]);
2933
}),
@@ -39,6 +43,9 @@ describe("OrganizationSettingsPage", () => {
3943

4044
it("redirects to default organization", async () => {
4145
server.use(
46+
http.get("/api/v2/entitlements", () => {
47+
return HttpResponse.json(MockEntitlementsWithMultiOrg);
48+
}),
4249
http.get("/api/v2/organizations", () => {
4350
// Default always preferred regardless of order.
4451
return HttpResponse.json([MockOrganization2, MockDefaultOrganization]);
@@ -60,6 +67,9 @@ describe("OrganizationSettingsPage", () => {
6067

6168
it("redirects to non-default organization", async () => {
6269
server.use(
70+
http.get("/api/v2/entitlements", () => {
71+
return HttpResponse.json(MockEntitlementsWithMultiOrg);
72+
}),
6373
http.get("/api/v2/organizations", () => {
6474
return HttpResponse.json([MockDefaultOrganization, MockOrganization2]);
6575
}),

0 commit comments

Comments
 (0)