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

decentraland / marketplace / 10032821866

22 Jul 2024 12:58AM UTC coverage: 66.714% (+0.1%) from 66.605%
10032821866

push

github

web-flow
feat: show correctly bids on nfts (#2270)

2654 of 5162 branches covered (51.41%)

Branch coverage included in aggregate %.

24 of 33 new or added lines in 8 files covered. (72.73%)

1 existing line in 1 file now uncovered.

7762 of 10451 relevant lines covered (74.27%)

77.9 hits per line

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

26.92
/webapp/src/modules/ui/asset/bid/reducer.ts
1
import {
2
  FETCH_BIDS_BY_ASSET_SUCCESS,
3
  FETCH_BIDS_BY_ASSET_REQUEST,
4
  FETCH_BIDS_BY_ADDRESS_SUCCESS,
5
  ARCHIVE_BID,
6
  UNARCHIVE_BID,
7
  FetchBidsByAddressSuccessAction,
8
  ArchiveBidAction,
9
  UnarchiveBidAction,
10
  FetchBidsByAssetSuccessAction,
11
  FetchBidsByAssetRequestAction
12
} from '../../../bid/actions'
34✔
13

14
export type BidUIState = {
15
  seller: string[]
16
  bidder: string[]
17
  archived: string[]
18
  asset: string[]
19
}
20

21
const INITIAL_STATE: BidUIState = {
34✔
22
  seller: [],
23
  bidder: [],
24
  archived: [],
25
  asset: []
26
}
27

28
type UIReducerAction =
29
  | FetchBidsByAddressSuccessAction
30
  | FetchBidsByAssetSuccessAction
31
  | ArchiveBidAction
32
  | UnarchiveBidAction
33
  | FetchBidsByAssetRequestAction
34

35
export function bidReducer(state: BidUIState = INITIAL_STATE, action: UIReducerAction) {
34✔
36
  switch (action.type) {
2,367!
37
    case FETCH_BIDS_BY_ASSET_REQUEST: {
NEW
38
      return {
×
39
        ...state,
40
        asset: []
41
      }
42
    }
43
    case FETCH_BIDS_BY_ADDRESS_SUCCESS: {
44
      const { sellerBids, bidderBids } = action.payload
×
45
      return {
×
46
        ...state,
47
        seller: sellerBids.map(bid => bid.id),
×
48
        bidder: bidderBids.map(bid => bid.id)
×
49
      }
50
    }
51
    case FETCH_BIDS_BY_ASSET_SUCCESS: {
52
      const { bids } = action.payload
×
53
      return {
×
54
        ...state,
NEW
55
        asset: bids.map(bid => bid.id)
×
56
      }
57
    }
58
    case ARCHIVE_BID: {
59
      const { bid } = action.payload
×
60
      return {
×
61
        ...state,
62
        archived: [...state.archived.filter(id => id !== bid.id), bid.id]
×
63
      }
64
    }
65
    case UNARCHIVE_BID: {
66
      const { bid } = action.payload
×
67
      return {
×
68
        ...state,
69
        archived: [...state.archived.filter(id => id !== bid.id)]
×
70
      }
71
    }
72
    default:
73
      return state
2,367✔
74
  }
75
}
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