How to use the wix-ui-test-utils/driver-factory.createDriverFactory 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 / Input / Input.spec.tsx View on Github external
describe('Input', () => {
  const createDriver = createDriverFactory(inputDriverFactory);

  it('should render', () => {
    const value = 'hello!';
    const driver = createDriver(<input value="{value}">);
    expect(driver.getValue()).toEqual(value);
  });

  describe('testkit', () =&gt; {
    it('should exist', () =&gt; {
      expect(
        isTestkitExists(<input>, inputTestkitFactory, {
          dataHookPropName: 'data-hook',
        }),
      ).toBe(true);
    });
  });
github wix / wix-ui-backoffice / src / components / Checkbox / Checkbox.spec.tsx View on Github external
describe('Checkbox', () =&gt; {
  const createDriver = createDriverFactory(checkboxDriverFactory);

  it('should be unchecked and not disabled by default', () =&gt; {
    const driver = createDriver();
    expect(driver.isChecked()).toBeFalsy();
    expect(driver.isDisabled()).toBeFalsy();
  });

  it('should be checked', () =&gt; {
    const driver = createDriver();
    expect(driver.isChecked()).toBeTruthy();
  });

  it('should be disabled', () =&gt; {
    const driver = createDriver();
    expect(driver.isDisabled()).toBeTruthy();
  });