How to use adslot-ui - 5 common examples

To help you get started, we’ve selected a few adslot-ui 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 Adslot / adslot-ui / src / components / Accordion / index.spec.jsx View on Github external
it('should render with props', () => {
    const wrapper = shallow(
      
        {panel1.content}
        {panel2.content}
        {panel3.content}
      
    );

    const cardElement = wrapper.find(Card.Content);
    expect(cardElement).to.have.length(1);

    const panelElements = cardElement.find(Accordion.Panel);
    expect(panelElements).to.have.length(3);

    const panelElement1 = panelElements.at(0);
    expect(panelElement1.prop('id')).to.equal('1');
    expect(panelElement1.prop('onClick')).to.be.a('function');

    const panelElement2 = panelElements.at(1);
    expect(panelElement2.prop('id')).to.equal('2');
    expect(panelElement2.prop('onClick')).to.be.a('function');

    const panelElement3 = panelElements.at(2);
    expect(panelElement3.prop('id')).to.equal('3');
    expect(panelElement3.prop('onClick')).to.be.a('function');
    expect(panelElement3.prop('dts')).to.equal('panel-3'); // should generate a dts from panel id
  });
github Adslot / adslot-ui / src / components / Accordion / index.spec.jsx View on Github external
it('should render with props', () => {
    const wrapper = shallow(
      
        {panel1.content}
        {panel2.content}
        {panel3.content}
      
    );

    const cardElement = wrapper.find(Card.Content);
    expect(cardElement).to.have.length(1);

    const panelElements = cardElement.find(Accordion.Panel);
    expect(panelElements).to.have.length(3);

    const panelElement1 = panelElements.at(0);
    expect(panelElement1.prop('id')).to.equal('1');
    expect(panelElement1.prop('onClick')).to.be.a('function');

    const panelElement2 = panelElements.at(1);
    expect(panelElement2.prop('id')).to.equal('2');
    expect(panelElement2.prop('onClick')).to.be.a('function');

    const panelElement3 = panelElements.at(2);
    expect(panelElement3.prop('id')).to.equal('3');
    expect(panelElement3.prop('onClick')).to.be.a('function');
github Adslot / adslot-ui / src / components / Accordion / index.spec.jsx View on Github external
it('should render with defaults', () => {
    const wrapper = shallow(
      
        {panel1.content}
      
    );
    const cardElement = wrapper.find(Card.Content);
    expect(cardElement).to.have.length(1);
    expect(cardElement.children()).to.have.length(1);
  });
github Adslot / adslot-ui / src / components / fastStatelessWrapper / index.spec.jsx View on Github external
it('should re-render on specified attribute change one level deep', () => {
    const GridFast = fastStatelessWrapper(Grid, ['mutable']);
    const props = {
      mutable: {
        one: true,
      },
      fixed: 'bar',
    };
    const nextProps = {
      mutable: {
        one: false,
      },
      fixed: 'bar',
    };
    const shallowRenderer = shallow();
    const shouldUpdate = shallowRenderer.instance().shouldComponentUpdate(nextProps);
    expect(shouldUpdate).to.equal(true);
  });
github Adslot / adslot-ui / src / components / Accordion / index.spec.jsx View on Github external
{panel1.content}
        
        {panel2.content}
        {panel3.content}
      
    );
    wrapper
      .find(Accordion.Panel)
      .at(0)
      .find('.panel-component-header')
      .simulate('click');

    expect(
      wrapper
        .find(Accordion.Panel)
        .at(0)
        .prop('isCollapsed')
    ).to.equal(true);
  });

adslot-ui

Core component library. By Adslot

MIT
Latest version published 1 month ago

Package Health Score

75 / 100
Full package analysis