import 'mocha'; import * as chai from 'chai'; import * as sinonChai from 'sinon-chai'; import PaymentMethodItemDriver from './PaymentMethodItem.driver'; import {eventually} from '../../../test/helpers'; chai.use(sinonChai); describe('CollapsedPayment component', () => { let driver: PaymentMethodItemDriver = null; beforeEach(() => { driver = new PaymentMethodItemDriver().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; }) ); });