import 'mocha'; import * as chai from 'chai'; import * as sinonChai from 'sinon-chai'; import PaymentMethodListDriver from './PaymentMethodList.driver'; import {eventually} from '../../../test/helpers'; chai.use(sinonChai); describe('CollapsedPayment component', () => { let driver: PaymentMethodListDriver = null; beforeEach(() => { driver = new PaymentMethodListDriver().when.render(); }); afterEach(() => driver.cleanup()); it(`should present the component`, () => eventually(() => { driver.has.root().should.be.true; }) ); it(`should call select callback on input click`, () => eventually(() => { const method = driver.when.click().get.handleMethodChange(); method.should.be.calledOnce; }) ); it(`should render only one item`, () => eventually(() => { chai.expect(driver.has.item()).to.be.true; }) ); });