2017-05-29 21:50:03 +03:00
|
|
|
import RSVP from 'rsvp';
|
2016-04-06 18:26:58 +03:00
|
|
|
import hbs from 'htmlbars-inline-precompile';
|
|
|
|
import sinon from 'sinon';
|
2019-01-02 12:58:55 +03:00
|
|
|
import {click, render} from '@ember/test-helpers';
|
2017-05-29 21:50:03 +03:00
|
|
|
import {describe, it} from 'mocha';
|
|
|
|
import {expect} from 'chai';
|
2019-01-02 12:58:55 +03:00
|
|
|
import {setupRenderingTest} from 'ember-mocha';
|
2016-04-06 18:26:58 +03:00
|
|
|
|
2018-01-05 18:38:23 +03:00
|
|
|
describe('Integration: Component: modal-transfer-owner', function () {
|
2019-01-02 12:58:55 +03:00
|
|
|
setupRenderingTest();
|
2016-04-06 18:26:58 +03:00
|
|
|
|
2019-01-02 12:58:55 +03:00
|
|
|
it('triggers confirm action', async function () {
|
2016-11-24 01:50:57 +03:00
|
|
|
let confirm = sinon.stub();
|
|
|
|
let closeModal = sinon.spy();
|
2016-04-06 18:26:58 +03:00
|
|
|
|
2016-11-24 01:50:57 +03:00
|
|
|
confirm.returns(RSVP.resolve({}));
|
2016-04-06 18:26:58 +03:00
|
|
|
|
2019-01-02 12:58:55 +03:00
|
|
|
this.set('confirm', confirm);
|
|
|
|
this.set('closeModal', closeModal);
|
2016-04-06 18:26:58 +03:00
|
|
|
|
2019-01-02 12:58:55 +03:00
|
|
|
await render(hbs`{{modal-transfer-owner confirm=(action confirm) closeModal=(action closeModal)}}`);
|
|
|
|
await click('.gh-btn.gh-btn-red');
|
2016-11-24 01:50:57 +03:00
|
|
|
|
|
|
|
expect(confirm.calledOnce, 'confirm called').to.be.true;
|
|
|
|
expect(closeModal.calledOnce, 'closeModal called').to.be.true;
|
|
|
|
});
|
|
|
|
});
|