Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe('AvatarGroup', () => {
const createDriver = createUniDriverFactory(avatarGroupDriverFactory);
it('should render', async () => {
const driver = createDriver();
expect(await driver.exists()).toBe(true);
});
describe('testkit', () => {
it('should exist', async () => {
expect(
await isUniTestkitExists(, avatarGroupTestkitFactory, {
dataHookPropName: 'data-hook',
}),
).toBe(true);
});
});
describe('OverlappingCard', () => {
const createDriver = createUniDriverFactory(overlappingCardDriverFactory);
it('should render info', async () => {
const valueAsString = '<div>info!</div>';
const value = <div>;
const driver = createDriver();
expect((await driver.getInfoContent()).innerHTML).toEqual(valueAsString);
});
it('should render image', async () => {
const valueAsString = '<div>image!</div>';
const value = <div>;
const driver = createDriver();
expect((await driver.getMediaContent()).innerHTML).toEqual(valueAsString);
});
it('should render ratio 50 as default', async () => {</div></div>
describe('Button', () => {
const createDriver = createUniDriverFactory(buttonDriverFactory);
it('should render', async () => {
const value = 'hello!';
const driver = createDriver(<button>{value}</button>);
expect(await driver.getButtonTextContent()).toEqual(value);
});
it('should set to fullWidth', async () => {
const driver = createDriver(<button>);
expect(await driver.isFullWidth()).toEqual(true);
});
it('should use mobile design', async () => {
const driver = createDriver(
TPAComponentsWrapper({ mobile: true })(</button><button>),
);</button>
describe('Modal', () => {
const createDriver = createUniDriverFactory(modalDriverFactory);
it('should render', async () => {
const driver = createDriver();
expect(await driver.exists()).toBeTruthy();
});
it('should be close', async () => {
const driver = createDriver();
expect(await driver.exists()).toBeFalsy();
});
it('should use mobile design', async () => {
const driver = createDriver(
TPAComponentsWrapper({ mobile: true })(
,
),
describe('Tabs', () => {
const createDriver = createUniDriverFactory(tabsDriverFactory);
let driver;
const items = [{ title: 'some-title-1' }, { title: 'some-title-2' }];
it('should render list of items with titles', async () => {
driver = createDriver();
const expectedTitles = items.map(item => item.title);
const receivedTitles = await Promise.all(
Array(items.length)
.fill(0)
.map((_, index) => driver.getTitleAt(index)),
);
expect(receivedTitles).toEqual(expectedTitles);
});
describe('Calendar', () => {
const createDriver = createUniDriverFactory(calendarDriverFactory);
it('should render', async () => {
const driver = createDriver();
expect(await driver.exists()).toBe(true);
});
it('should use mobile design', async () => {
const driver = createDriver(
TPAComponentsWrapper({ mobile: true })(),
);
expect(await driver.isMobile()).toBe(true);
});
describe('testkit', () => {
it('should exist', async () => {
expect(
describe('ToggleSwitch', () => {
const createDriver = createUniDriverFactory(toggleSwitchDriverFactory);
it('should be checked', async () => {
const driver = createDriver();
expect(await driver.isChecked()).toBeTruthy();
});
it('should be disabled', async () => {
const driver = createDriver();
expect(await driver.isDisabled()).toBeTruthy();
});
it('should change state', async () => {
const driver = createDriver();