mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-26 02:21:06 -04:00
Fix CI
This commit is contained in:
@@ -45,9 +45,9 @@ describe('banUser', () => {
|
||||
expect(sharedAnalytics.trackPublicEvent).toBeCalledWith(mockAuth.uid, 'ban user', {
|
||||
userId: mockUser.userId,
|
||||
})
|
||||
expect(supabaseUsers.updateUserData).toBeCalledTimes(1)
|
||||
expect(supabaseUsers.updateUserData).toBeCalledWith(mockPg, mockUser.userId, {
|
||||
is_banned_from_posting: true,
|
||||
expect(supabaseUsers.updateUser).toBeCalledTimes(1)
|
||||
expect(supabaseUsers.updateUser).toBeCalledWith(mockUser.userId, {
|
||||
isBannedFromPosting: true,
|
||||
})
|
||||
})
|
||||
|
||||
@@ -68,8 +68,8 @@ describe('banUser', () => {
|
||||
expect(sharedAnalytics.trackPublicEvent).toBeCalledWith(mockAuth.uid, 'ban user', {
|
||||
userId: mockUser.userId,
|
||||
})
|
||||
expect(supabaseUsers.updateUserData).toBeCalledWith(mockPg, mockUser.userId, {
|
||||
is_banned_from_posting: false,
|
||||
expect(supabaseUsers.updateUser).toBeCalledWith(mockUser.userId, {
|
||||
isBannedFromPosting: false,
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -227,7 +227,7 @@ describe('createComment', () => {
|
||||
name: 'Mock Creator',
|
||||
username: 'mock.creator.username',
|
||||
avatarUrl: 'mock.creator.avatarurl',
|
||||
is_banned_from_posting: true,
|
||||
isBannedFromPosting: true,
|
||||
}
|
||||
const mockContent = {
|
||||
content: {
|
||||
|
||||
@@ -183,7 +183,7 @@ describe('createPrivateUserMessageChannel', () => {
|
||||
const mockAuth = {uid: '321'} as AuthedUser
|
||||
const mockReq = {} as any
|
||||
const mockCreator = {
|
||||
is_banned_from_posting: true,
|
||||
isBannedFromPosting: true,
|
||||
}
|
||||
|
||||
;(sharedUtils.getUser as jest.Mock).mockResolvedValue(mockCreator)
|
||||
@@ -207,7 +207,7 @@ describe('createPrivateUserMessageChannel', () => {
|
||||
const mockAuth = {uid: '321'} as AuthedUser
|
||||
const mockReq = {} as any
|
||||
const mockCreator = {
|
||||
is_banned_from_posting: false,
|
||||
isBannedFromPosting: false,
|
||||
}
|
||||
|
||||
;(sharedUtils.getUser as jest.Mock).mockResolvedValue(mockCreator)
|
||||
@@ -237,7 +237,7 @@ describe('createPrivateUserMessageChannel', () => {
|
||||
const mockAuth = {uid: '321'} as AuthedUser
|
||||
const mockReq = {} as any
|
||||
const mockCreator = {
|
||||
is_banned_from_posting: false,
|
||||
isBannedFromPosting: false,
|
||||
}
|
||||
|
||||
;(sharedUtils.getUser as jest.Mock).mockResolvedValue(mockCreator)
|
||||
|
||||
@@ -87,7 +87,7 @@ describe('createPrivateUserMessage', () => {
|
||||
const mockAuth = {uid: '321'} as AuthedUser
|
||||
const mockReq = {} as any
|
||||
const mockCreator = {
|
||||
is_banned_from_posting: true,
|
||||
isBannedFromPosting: true,
|
||||
}
|
||||
|
||||
;(sharedUtils.getUser as jest.Mock).mockResolvedValue(mockCreator)
|
||||
|
||||
@@ -124,7 +124,7 @@ describe('loadProfiles', () => {
|
||||
expect(sqlBuilder.renderSql).toBeCalledTimes(3)
|
||||
expect(sqlBuilder.select).toBeCalledTimes(3)
|
||||
expect(sqlBuilder.from).toBeCalledTimes(2)
|
||||
expect(sqlBuilder.where).toBeCalledTimes(8)
|
||||
expect(sqlBuilder.where).toBeCalledTimes(7)
|
||||
expect(sqlBuilder.join).toBeCalledTimes(1)
|
||||
})
|
||||
|
||||
|
||||
@@ -49,17 +49,8 @@ describe('updateProfiles', () => {
|
||||
)
|
||||
expect(removePinnedUrlFromPhotoUrls).toBeCalledTimes(1)
|
||||
expect(removePinnedUrlFromPhotoUrls).toBeCalledWith(mockProps)
|
||||
expect(supabaseUsers.updateUserData).toBeCalledTimes(1)
|
||||
expect(supabaseUsers.updateUserData).toBeCalledWith(expect.any(Object), mockAuth.uid, {
|
||||
avatarUrl: mockProps.pinned_url,
|
||||
})
|
||||
expect(supabaseUtils.update).toBeCalledTimes(1)
|
||||
expect(supabaseUtils.update).toBeCalledWith(
|
||||
expect.any(Object),
|
||||
'profiles',
|
||||
'user_id',
|
||||
expect.any(Object),
|
||||
)
|
||||
expect(supabaseUsers.updateUserData).toBeCalledTimes(0)
|
||||
expect(supabaseUtils.update).toBeCalledTimes(0)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user