File tree 3 files changed +7
-5
lines changed
app/components/pubs/PubEditor
3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ describe("createPubRecursive", () => {
73
73
} ,
74
74
} ) ;
75
75
getLoginData . mockImplementation ( ( ) => {
76
- return { user : loginUser ? { id : users . john . id } : undefined } ;
76
+ return { user : loginUser ? { id : users . john . id , isSuperAdmin : false } : null } ;
77
77
} ) ;
78
78
79
79
const { createPubRecursive } = await import ( "./actions" ) ;
@@ -162,7 +162,7 @@ describe("updatePub", () => {
162
162
} ,
163
163
} ) ;
164
164
getLoginData . mockImplementation ( ( ) => {
165
- return { user : loginUser ? { id : users . john . id } : undefined } ;
165
+ return { user : loginUser ? { id : users . john . id , isSuperAdmin : false } : null } ;
166
166
} ) ;
167
167
findCommunityBySlug . mockImplementation ( ( ) => {
168
168
return community ;
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ describe("live", () => {
122
122
const { community, users, pubs } = await seed ( trx ) ;
123
123
124
124
getLoginData . mockImplementation ( ( ) => {
125
- return undefined ;
125
+ return { user : null } ;
126
126
} ) ;
127
127
128
128
const createForm = await import ( "~/app/c/[communitySlug]/forms/actions" ) . then (
@@ -143,7 +143,7 @@ describe("live", () => {
143
143
test ( "getForm and createForm" , async ( ) => {
144
144
const trx = getTrx ( ) ;
145
145
getLoginData . mockImplementation ( ( ) => {
146
- return { id : "123" , isSuperAdmin : true } ;
146
+ return { user : { id : "123" , isSuperAdmin : true } } ;
147
147
} ) ;
148
148
149
149
const { community, users, pubs } = await seed ( trx ) ;
Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ export const mockServerCode = async () => {
12
12
13
13
return {
14
14
testDb,
15
- getLoginData : vi . fn ( ) ,
15
+ getLoginData : vi . fn ( ( ) : { user : { isSuperAdmin : boolean } | null } => ( {
16
+ user : { isSuperAdmin : false } ,
17
+ } ) ) ,
16
18
findCommunityBySlug : vi . fn ( ) ,
17
19
} ;
18
20
} ) ;
You can’t perform that action at this time.
0 commit comments