(cart)
| 11 | const SiteContext = React.createContext() |
| 12 | |
| 13 | function calculateTotal(cart) { |
| 14 | const total = cart.reduce((acc, next) => { |
| 15 | const quantity = next.quantity |
| 16 | acc = acc + JSON.parse(next.price) * quantity |
| 17 | return acc |
| 18 | }, 0) |
| 19 | return total |
| 20 | } |
| 21 | |
| 22 | class ContextProviderComponent extends React.Component { |
| 23 | componentDidMount() { |
no outgoing calls
no test coverage detected