Skip to content

Commit

Permalink
test: better description
Browse files Browse the repository at this point in the history
  • Loading branch information
Danijel Bjelajac committed Nov 6, 2023
1 parent 46714c3 commit 9461e9f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/Activities/hooks/useCurrentActivity.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { waitFor } from '@testing-library/react'
import { activity_mocks, renderActivityHook } from '../../../../spec'
import { useCurrentActivity } from './useCurrentActivity'
import { ActivityStatus } from '../types'
import { useCurrentActivity } from './useCurrentActivity'

describe('useCurrentActivity', () => {
describe('When no activities', () => {
Expand All @@ -21,7 +21,9 @@ describe('useCurrentActivity', () => {
expect(result.current.currentActivity).toBeUndefined()
})
})
})

describe('With done and active activities', () =>
it('should return waitingForNewActivities: false, and first active activity as currentActivity', async () => {
const activities = [
activity_mocks.activity({
Expand All @@ -48,6 +50,5 @@ describe('useCurrentActivity', () => {
expect(result.current.waitingForNewActivities).toBeFalsy()
expect(result.current.currentActivity!.id).toEqual(activities[1].id)
})
})
})
}))
})

0 comments on commit 9461e9f

Please sign in to comment.