Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should render tabs container with 3 items', () => {
// ARRANGE
const content = <div style="{{width:"> {}} /></div>;
const { rerender, queryAllByTestId } = renderWithProvider(content);
// ACT
setTimeout(() => {
rerender(content);
// ASSERT
expect(queryAllByTestId('tab-container').length).toBe(3);
}, WAIT_FOR_HOOKS)
});
it('should render dropdown', () => {
// ARRANGE
const handleConfigurationAction = jest.fn();
const content = <div style="{{width:"> {}} configuration={{label: 'Button label', action: handleConfigurationAction}} /></div>;
const { baseElement } = renderWithProvider(content, { container: document.body});
// ASSERT
expect(baseElement.getElementsByClassName('ant-dropdown')).toBeTruthy();
});
const setup = ({
disabled = false,
maxLength,
autoComplete,
name = 'name-of-input',
hideIcon,
}: {
disabled?: boolean,
maxLength?: number,
autoComplete?: string,
name?: string
hideIcon?: boolean
}) => {
const utils = renderWithProvider(
onChange(e.target.value)}
maxLength={maxLength}
placeholder={PLACEHOLDER}
size={'normal'}
error={false}
disabled={disabled}
autoComplete={autoComplete}
hideIcon={hideIcon}
/>
)
const input = utils.getByPlaceholderText(PLACEHOLDER) as HTMLInputElement