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, { Fragment, PureComponent } from 'react'; | |
import PropTypes from 'prop-types'; | |
import cx from 'classnames'; | |
import loadable from '@loadable/component'; | |
import { Text } from '@avito/mobile-components'; | |
import { role } from '@avito/utils'; | |
import { withToggles } from '@avito-core/toggles'; | |
import { throttle } from '@avito/utils/src/helpers'; | |
import { sources } from '@plugins/withFavorite'; | |
import { getLogParams } from '@plugins/withLogObserver'; |
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
// Define function power - an alias to Math.pow(). | |
const power = (base, power) => Math.pow(base, power); | |
// Implement function `square(n)`, which returns square of its argument. | |
// The function may or may not reuse function `power`. | |
const square = num => power(num, 2); | |
// Implement function `cube(n)` using partial application | |
// The function should return power of three for the given argument. | |
const cube = power.bind(null , 3); |
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
Test.before(t => { | |
t.context.props = { | |
classes: Object.assign(...Object.keys(styles).map(className => ({[className]: `${className}`}))), | |
allowedToAction: true, | |
clearFilters: () => {}, | |
toggleFilters: () => {}, | |
remove: () => {} | |
}; | |
}); |
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
/* eslint-disable id-length*/ | |
import Test from 'ava'; | |
import React from 'react'; | |
import Render from 'react-test-renderer'; | |
import kpgz from '../kpgz.jsx'; | |
import styles from '../style.js'; | |
const Kpgz = kpgz({ | |
Checkbox: ({children, ...rest}) => <checkbox {...rest}>{children}</checkbox>, | |
TextInput: ({children, ...rest}) => <textInput {...rest}>{children}</textInput>, |