How to use the adslot-ui.Accordion.Panel function in adslot-ui

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
{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 25 days ago

Package Health Score

70 / 100
Full package analysis