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

IQSS / dataverse-frontend / 18043322716

26 Sep 2025 04:18PM UTC coverage: 97.373% (-0.7%) from 98.052%
18043322716

push

github

g-saracca
test: fix due to changes in mappers

3591 of 3760 branches covered (95.51%)

Branch coverage included in aggregate %.

7307 of 7432 relevant lines covered (98.32%)

11435.54 hits per line

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

88.89
/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
) {
10
  const [isLoading, setIsLoading] = useState(true)
1,210✔
11
  const [collection, setCollection] = useState<Collection>()
1,210✔
12

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

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

32
  return { collection, isLoading, refetchCollection: getCollection }
786✔
33
}
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