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

IQSS / dataverse-frontend / 5401532692

28 Jun 2023 01:13PM UTC coverage: 98.336%. Remained the same
5401532692

push

github

GPortas
Fixed: typo in run-env.sh execution

136 of 142 branches covered (95.77%)

Branch coverage included in aggregate %.

455 of 459 relevant lines covered (99.13%)

72.31 hits per line

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

92.86
/src/sections/layout/header/useUser.tsx
1
import { UserRepository } from '../../../users/domain/repositories/UserRepository'
2
import { User } from '../../../users/domain/models/User'
3
import { useEffect, useState } from 'react'
4
import { getUser } from '../../../users/domain/useCases/getUser'
5
import { logOut } from '../../../users/domain/useCases/logOut'
6

7
export function useUser(repository: UserRepository) {
27✔
8
  const [user, setUser] = useState<User>()
27✔
9

10
  useEffect(() => {
27✔
11
    getUser(repository)
13✔
12
      .then((user: User | void) => {
13
        user && setUser(user)
10✔
14
      })
15
      .catch((error) => console.error('There was an error getting the authenticated user', error))
3✔
16
  }, [repository])
17

18
  const submitLogOut = () => {
27✔
19
    logOut(repository)
2✔
20
      .then(() => {
21
        setUser(undefined)
2✔
22
      })
23
      .catch((error) => console.error('There was an error removing the authenticated user', error))
×
24
  }
25

26
  return { user, submitLogOut }
27✔
27
}
8✔
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

© 2025 Coveralls, Inc