How to use rax-test-renderer - 10 common examples

To help you get started, we’ve selected a few rax-test-renderer 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 alibaba / rax / components / rax-calendar / src / __tests__ / index.js View on Github external
it('renders correctly', () => {
  const tree = renderer.create(
    
  ).toJSON();

  expect(tree).toMatchSnapshot();
});
github alibaba / rax / components / rax-modal / src / __tests__ / index.js View on Github external
it('children in Modal', () => {
    const component = renderer.create(
      
        
      
    );
    let tree = component.toJSON();

    expect(tree.children[0].children[0].children[0]).toBe('Example');
  });
github alibaba / rax / packages / rax-touchable / src / __tests__ / Touchable.weex.js View on Github external
it('render tag Touchable', () => {
    const component = renderer.create(
      Example
    );
    let tree = component.toJSON();

    expect(tree.tagName).toEqual('DIV');
    expect(tree.children[0]).toEqual('Example');
  });
});
github alibaba / rax / components / rax-modal / src / __tests__ / index.js View on Github external
it('controlled Modal', () => {
    const mockHideCallback = jest.fn();

    const component = renderer.create(
      
    );

    jest.runAllTimers();
    expect(mockHideCallback).toHaveBeenCalled();
  });
});
github alibaba / rax / components / rax-link / src / __tests__ / Link.weex.js View on Github external
it('should render a link', () => {
    const component = renderer.create(
      Example
    );
    let tree = component.toJSON();
    expect(tree.tagName).toEqual('A');
    expect(tree.children[0].tagName).toEqual('TEXT');
    expect(tree.children[0].attributes.value).toEqual('Example');
  });
});
github alibaba / rax / packages / rax-textinput / src / __tests__ / TextInput.js View on Github external
it('render tag TextInput', () => {
    const component = renderer.create(
      
    );
    let tree = component.toJSON();
    expect(tree.tagName).toEqual('INPUT');
  });
github alibaba / rax / packages / rax-components / src / __tests__ / Switch.js View on Github external
beforeEach(() => {
    component = renderer.create(
      
    );
  });
  it('should render a switch', () => {
github alibaba / rax / packages / rax-tabheader / src / __tests__ / Tabheader.js View on Github external
describe('tabheader', () => {
  const component = renderer.create(
     {
        return ;
      }}
      renderSelect={(item, index) => {
        return ;
      }}
      onPress={(index) => {}}
      onSelect={(index) => {}}
      selected={0}
      itemWidth={166}
      dropDownCols={4}
      type={'dropDown-border-scroll'} />
  );
github alibaba / rax / packages / rax-scrollview / src / __tests__ / ScrollView.js View on Github external
beforeEach(() => {
    component1 = renderer.create(
      
    );
    component2 = renderer.create(
      
    );
  });

rax-test-renderer

Rax renderer for snapshot testing.

BSD-3-Clause
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis

Popular rax-test-renderer functions

Similar packages