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

IQSS / dataverse-frontend / 23954250439

03 Apr 2026 04:52PM UTC coverage: 97.448% (-0.6%) from 98.063%
23954250439

Pull #908

github

ChengShi-1
fix: test coverage
Pull Request #908: Manage Dataset Templates Integration

4563 of 4779 branches covered (95.48%)

Branch coverage included in aggregate %.

363 of 380 new or added lines in 26 files covered. (95.53%)

50 existing lines in 20 files now uncovered.

8876 of 9012 relevant lines covered (98.49%)

10431.48 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)
3,788✔
11
  const [collection, setCollection] = useState<Collection>()
3,788✔
12

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

28
  useEffect(() => {
3,364✔
29
    getCollection()
1,480✔
30
  }, [getCollection])
48✔
31

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