Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* global mount */
import AppLike from 'test/AppLike'
import React from 'react'
import SelectDates from './SelectDates'
import Select from 'react-select'
Select.defaultProps.menuIsOpen = true
const isButtonActive = node => !node.is('.SelectDates__Button--disabled')
describe('SelectDates', () => {
beforeEach(() => {})
const options = [
{ yearMonth: '2017-10' },
{ yearMonth: '2017-11' },
{ yearMonth: '2018-01' },
{ yearMonth: '2018-02' },
{ yearMonth: '2018-04' }
]
const findButtons = root => {
const prev = root.find('RoundChip.SelectDates__Button--prev')
const next = root.find('RoundChip.SelectDates__Button--next')
function menuRenderer(params) {
// use default renderer in a hacky way
const menu = Select.defaultProps.menuRenderer(params);
return {menu};
}
return {
boxSizing: 'border-box',
cursor: 'pointer',
display: 'block',
padding: '8px 10px',
opacity: isDisabled ? 0.5 : 1,
backgroundColor,
color,
'& [role="option"]': {
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis'
}
};
}, ReactSelect.defaultProps.optionComponent);
export default Option;
const renderItems = (params) => (
{Select.defaultProps.menuRenderer(params)}
);