• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IQSS / dataverse-frontend / 15209297293

23 May 2025 11:33AM UTC coverage: 97.548% (+0.08%) from 97.469%
15209297293

Pull #713

github

web-flow
Merge 00955b997 into c6a842c09
Pull Request #713: Change alerts to toasts

3009 of 3146 branches covered (95.65%)

Branch coverage included in aggregate %.

21 of 21 new or added lines in 6 files covered. (100.0%)

2 existing lines in 2 files now uncovered.

6737 of 6845 relevant lines covered (98.42%)

12462.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
/src/sections/collection/useCollection.tsx
1
import { CollectionRepository } from '../../collection/domain/repositories/CollectionRepository'
2
import { Collection } from '../../collection/domain/models/Collection'
3
import { useCallback, useEffect, useState } from 'react'
4
import { getCollectionById } from '../../collection/domain/useCases/getCollectionById'
5

6
export function useCollection(
7
  collectionRepository: CollectionRepository,
8
  collectionId?: string | undefined
9
) {
734✔
10
  const [isLoading, setIsLoading] = useState(true)
1,158✔
11
  const [collection, setCollection] = useState<Collection>()
1,158✔
12

424✔
13
  const getCollection = useCallback(() => {
734✔
14
    setIsLoading(true)
724✔
15
    setCollection(undefined)
485✔
16
    getCollectionById(collectionRepository, collectionId)
485✔
17
      .then((collection: Collection) => {
185✔
18
        setCollection(collection)
300✔
19
      })
185✔
20
      .catch((error) => {
21
        console.error('There was an error getting the collection', error)
×
UNCOV
22
      })
×
23
      .finally(() => {
24
        setIsLoading(false)
300✔
25
      })
185✔
26
  }, [collectionRepository, collectionId])
27

28
  useEffect(() => {
734✔
29
    getCollection()
724✔
30
  }, [getCollection])
48✔
31

32
  return { collection, isLoading, refetchCollection: getCollection }
734✔
33
}
66✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc