@zohodesk/components
Version:
Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development
100 lines • 2.92 kB
JavaScript
import React from 'react';
import { render } from '@testing-library/react';
import ArrowIcon from "../ArrowIcon";
describe('ArrowIcon', () => {
test('rendering the defult props', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ArrowIcon, null));
expect(asFragment()).toMatchSnapshot();
});
test('Should be render with dataId', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ArrowIcon, {
dataId: "ArrowIcon-test-dataId"
}));
expect(asFragment()).toMatchSnapshot();
});
test('Should be render isRotated is true', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ArrowIcon, {
isRotated: true
}));
expect(asFragment()).toMatchSnapshot();
});
test('Should be render isActive is true', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ArrowIcon, {
isActive: true
}));
expect(asFragment()).toMatchSnapshot();
});
test('Should be render isDisabled is true', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ArrowIcon, {
isDisabled: true
}));
expect(asFragment()).toMatchSnapshot();
});
test('Should be render isReadOnly is true', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ArrowIcon, {
isReadOnly: true
}));
expect(asFragment()).toMatchSnapshot();
});
test('Should be render with customClass', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ArrowIcon, {
customClass: {
iconClass: 'arrowIcon_iconClass',
containerClass: 'arrowIcon_containerClass'
}
}));
expect(asFragment()).toMatchSnapshot();
});
test('Should be render with a11yAttributes', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ArrowIcon, {
a11yAttributes: {
'data-a11y-focus': true
}
}));
expect(asFragment()).toMatchSnapshot();
});
test('Should be render with tagAttributes', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ArrowIcon, {
tagAttributes: {
title: 'hello here is title'
}
}));
expect(asFragment()).toMatchSnapshot();
});
test('Should be render with customProps', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ArrowIcon, {
customProps: {
testId: 'hereIsTestId'
}
}));
expect(asFragment()).toMatchSnapshot();
});
test('Should be render with renderCustomToggleIndicator', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ArrowIcon, {
renderCustomToggleIndicator: /*#__PURE__*/React.createElement("div", null, "Indicator")
}));
expect(asFragment()).toMatchSnapshot();
});
});