This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const httpErrorCodes = [400, 500, 501, 504] | |
| module.exports.checkForRequestError = (requestData, errorList = httpErrorCodes) => | |
| requestData.statusCode && errorList.indexOf(requestData.statusCode > -1) | |
| module.exports.setupCouponActivationData = (requestParams, context, ee, next) => { | |
| const coupons = context.vars.coupon_v2 | |
| const filteredCoupons = coupons.find(coupon => !coupon.active) | |
| context.vars.coupon_v2 = filteredCoupons ? filteredCoupons : coupons[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import { shallow } from 'enzyme'; | |
| import PrivateRoute from './Routes.js'; | |
| const mockComponent = <h1>Test component</h1>; | |
| describe('Routes Unit Test', () => { | |
| describe('Happy path', () => { | |
| test('It should render a component when isUserLogged is true', () => { | |
| const wrapper = shallow(<PrivateRoute component={mockComponent} isUserLogged={true}/>); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Card = (props) => { | |
| return ( | |
| <div> | |
| <img width="100" src={props.avatar_url} /> | |
| <div>{props.name}</div> | |
| <div>{props.company}</div> | |
| </div> | |
| ); | |
| }; |
NewerOlder