How to use the wix-ui-test-utils/uni-driver-factory.createUniDriverFactory function in wix-ui-test-utils

To help you get started, we’ve selected a few wix-ui-test-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wix / wix-ui-tpa / src / components / AvatarGroup / AvatarGroup.spec.tsx View on Github external
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);
    });
  });
github wix / wix-ui-tpa / src / components / OverlappingCard / OverlappingCard.spec.tsx View on Github external
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 () =&gt; {
    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 () =&gt; {</div></div>
github wix / wix-ui-tpa / src / components / Button / Button.spec.tsx View on Github external
describe('Button', () =&gt; {
  const createDriver = createUniDriverFactory(buttonDriverFactory);

  it('should render', async () =&gt; {
    const value = 'hello!';
    const driver = createDriver(<button>{value}</button>);
    expect(await driver.getButtonTextContent()).toEqual(value);
  });

  it('should set to fullWidth', async () =&gt; {
    const driver = createDriver(<button>);
    expect(await driver.isFullWidth()).toEqual(true);
  });

  it('should use mobile design', async () =&gt; {
    const driver = createDriver(
      TPAComponentsWrapper({ mobile: true })(</button><button>),
    );</button>
github wix / wix-ui-tpa / src / components / Modal / Modal.spec.tsx View on Github external
describe('Modal', () =&gt; {
  const createDriver = createUniDriverFactory(modalDriverFactory);

  it('should render', async () =&gt; {
    const driver = createDriver();
    expect(await driver.exists()).toBeTruthy();
  });

  it('should be close', async () =&gt; {
    const driver = createDriver();
    expect(await driver.exists()).toBeFalsy();
  });

  it('should use mobile design', async () =&gt; {
    const driver = createDriver(
      TPAComponentsWrapper({ mobile: true })(
        ,
      ),
github wix / wix-ui-tpa / src / components / Tabs / Tabs.spec.tsx View on Github external
describe('Tabs', () =&gt; {
  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 () =&gt; {
    driver = createDriver();

    const expectedTitles = items.map(item =&gt; item.title);
    const receivedTitles = await Promise.all(
      Array(items.length)
        .fill(0)
        .map((_, index) =&gt; driver.getTitleAt(index)),
    );

    expect(receivedTitles).toEqual(expectedTitles);
  });
github wix / wix-ui-tpa / src / components / Calendar / Calendar.spec.tsx View on Github external
describe('Calendar', () =&gt; {
  const createDriver = createUniDriverFactory(calendarDriverFactory);

  it('should render', async () =&gt; {
    const driver = createDriver();
    expect(await driver.exists()).toBe(true);
  });

  it('should use mobile design', async () =&gt; {
    const driver = createDriver(
      TPAComponentsWrapper({ mobile: true })(),
    );
    expect(await driver.isMobile()).toBe(true);
  });

  describe('testkit', () =&gt; {
    it('should exist', async () =&gt; {
      expect(
github wix / wix-ui-tpa / src / components / ToggleSwitch / ToggleSwitch.spec.tsx View on Github external
describe('ToggleSwitch', () =&gt; {
  const createDriver = createUniDriverFactory(toggleSwitchDriverFactory);

  it('should be checked', async () =&gt; {
    const driver = createDriver();

    expect(await driver.isChecked()).toBeTruthy();
  });

  it('should be disabled', async () =&gt; {
    const driver = createDriver();

    expect(await driver.isDisabled()).toBeTruthy();
  });

  it('should change state', async () =&gt; {
    const driver = createDriver();