This file contains 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> | |
); | |
}; |
This file contains 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 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 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
config: | |
target: "https://you.target.api" | |
payload: | |
path: "../a_random_imported_file" | |
fields: | |
- "userId" | |
order: random | |
delimiter: "," | |
cast: false | |
tls: |
This file contains 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
scenarios: | |
- name: "Resource Scenario" | |
flow: | |
- get: | |
url: "/a/group/of/random/resources" | |
afterResponse: logResponse | |
capture: | |
json: $ | |
as: data | |
- log: "Result: {{ data }} \n" |
This file contains 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 fs = require('fs') | |
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) |
This file contains 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
scenarios: | |
- name: "Resource Scenario" | |
flow: | |
- get: | |
url: "/a/group/of/random/resources" | |
afterResponse: logResponse | |
capture: | |
json: $ | |
as: data | |
- log: "Result: {{ data }} \n" |
This file contains 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
config: | |
target: "https://you.target.api" | |
payload: | |
path: "../a_random_imported_file" | |
fields: | |
- "userId" | |
order: random | |
delimiter: "," | |
cast: false | |
tls: |
This file contains 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.setupActivationData = (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 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 fs = require('fs') | |
const httpErrorCodes = [400, 500, 501, 504] | |
module.exports.checkForRequestError = (requestData, errorList = httpErrorCodes) => | |
requestData.statusCode && errorList.indexOf(requestData.statusCode > -1) | |
module.exports.setupData = (requestParams, context, ee, next) => { | |
const coupons = context.vars.coupon_v2 | |
const filteredCoupons = coupons.find(coupon => !coupon.active) |
OlderNewer