@@ -2,6 +2,7 @@ import { screen, within } from "@testing-library/react";
2
2
import { http , HttpResponse } from "msw" ;
3
3
import {
4
4
MockDefaultOrganization ,
5
+ MockEntitlementsWithMultiOrg ,
5
6
MockOrganization2 ,
6
7
} from "testHelpers/entities" ;
7
8
import {
@@ -24,6 +25,9 @@ const renderPage = async () => {
24
25
describe ( "OrganizationSettingsPage" , ( ) => {
25
26
it ( "has no editable organizations" , async ( ) => {
26
27
server . use (
28
+ http . get ( "/api/v2/entitlements" , ( ) => {
29
+ return HttpResponse . json ( MockEntitlementsWithMultiOrg ) ;
30
+ } ) ,
27
31
http . get ( "/api/v2/organizations" , ( ) => {
28
32
return HttpResponse . json ( [ MockDefaultOrganization , MockOrganization2 ] ) ;
29
33
} ) ,
@@ -39,6 +43,9 @@ describe("OrganizationSettingsPage", () => {
39
43
40
44
it ( "redirects to default organization" , async ( ) => {
41
45
server . use (
46
+ http . get ( "/api/v2/entitlements" , ( ) => {
47
+ return HttpResponse . json ( MockEntitlementsWithMultiOrg ) ;
48
+ } ) ,
42
49
http . get ( "/api/v2/organizations" , ( ) => {
43
50
// Default always preferred regardless of order.
44
51
return HttpResponse . json ( [ MockOrganization2 , MockDefaultOrganization ] ) ;
@@ -60,6 +67,9 @@ describe("OrganizationSettingsPage", () => {
60
67
61
68
it ( "redirects to non-default organization" , async ( ) => {
62
69
server . use (
70
+ http . get ( "/api/v2/entitlements" , ( ) => {
71
+ return HttpResponse . json ( MockEntitlementsWithMultiOrg ) ;
72
+ } ) ,
63
73
http . get ( "/api/v2/organizations" , ( ) => {
64
74
return HttpResponse . json ( [ MockDefaultOrganization , MockOrganization2 ] ) ;
65
75
} ) ,