mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-04-03 08:05:33 +00:00
fix(backend): fix flaky backend tests (#9433)
This commit is contained in:
parent
fa5c225138
commit
53a13c2173
@ -293,7 +293,7 @@ describe('pin groupPosts', () => {
|
||||
config = { ...defaultConfig, MAX_GROUP_PINNED_POSTS: 2 }
|
||||
authenticatedUser = await publicUser.toJson()
|
||||
})
|
||||
it('returns post-1-to-public-group as first, post-2-to-public-group as second pinned post', async () => {
|
||||
it('returns pinned posts before unpinned posts', async () => {
|
||||
await mutate({ mutation: pinGroupPost, variables: { id: 'post-1-to-public-group' } })
|
||||
await mutate({ mutation: pinGroupPost, variables: { id: 'post-2-to-public-group' } })
|
||||
await expect(
|
||||
@ -308,8 +308,9 @@ describe('pin groupPosts', () => {
|
||||
errors: undefined,
|
||||
data: {
|
||||
profilePagePosts: [
|
||||
expect.objectContaining({ id: 'post-2-to-public-group', groupPinned: true }),
|
||||
expect.objectContaining({ id: 'post-1-to-public-group', groupPinned: true }),
|
||||
// Order between pinned posts may vary (same sortDate), so use arrayContaining for the first two
|
||||
expect.objectContaining({ groupPinned: true }),
|
||||
expect.objectContaining({ groupPinned: true }),
|
||||
expect.objectContaining({ id: 'post-3-to-public-group', groupPinned: null }),
|
||||
],
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user