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

decentraland / marketplace / 9604252205

20 Jun 2024 08:55PM UTC coverage: 66.593% (+0.09%) from 66.499%
9604252205

push

github

web-flow
fix location error (#2263)

2606 of 5072 branches covered (51.38%)

Branch coverage included in aggregate %.

30 of 40 new or added lines in 7 files covered. (75.0%)

1 existing line in 1 file now uncovered.

7606 of 10263 relevant lines covered (74.11%)

77.63 hits per line

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

95.45
/webapp/src/components/AssetList/utils.ts
1
import { matchPath } from 'react-router-dom'
2✔
2
import { locations } from '../../modules/routing/locations'
2✔
3

NEW
4
export function matchAppRoute<T extends Record<string, string>>(path: string, route: string) {
×
5
  return matchPath<T>(path, { path: route, strict: true, exact: true })
18✔
6
}
7

8
export function getLastVisitedElementId(currentLocation: string, lastVisitedLocation: string) {
5✔
9
  const matchLands = matchAppRoute(currentLocation, locations.lands())
5✔
10
  const matchCollectibles = matchAppRoute(currentLocation, locations.browse())
5✔
11
  const previousMatchNfts = matchAppRoute<{ contractAddress: string; tokenId: string }>(lastVisitedLocation, locations.nft())
5✔
12

13
  if ((matchLands && previousMatchNfts) || (matchCollectibles && previousMatchNfts)) {
5✔
14
    return `${previousMatchNfts.params.contractAddress}-${previousMatchNfts.params.tokenId}`
2✔
15
  }
16

17
  const previousMatchItems = matchAppRoute<{ contractAddress: string; itemId: string }>(lastVisitedLocation, locations.item())
3✔
18

19
  if (matchCollectibles && previousMatchItems) {
3✔
20
    return `${previousMatchItems.params.contractAddress}-${previousMatchItems.params.itemId}`
1✔
21
  }
22

23
  return null
2✔
24
}
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