Skip to content

Instantly share code, notes, and snippets.

/* 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>,
Test.before(t => {
t.context.props = {
classes: Object.assign(...Object.keys(styles).map(className => ({[className]: `${className}`}))),
allowedToAction: true,
clearFilters: () => {},
toggleFilters: () => {},
remove: () => {}
};
});
@dmitrysurkin
dmitrysurkin / 1-power.js
Created January 1, 2021 11:59
1-power.js
// 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);
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';