2020-02-13 19:44:57 +00:00
|
|
|
import { module, test } from 'qunit';
|
|
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
|
|
import { render } from '@ember/test-helpers';
|
|
|
|
import hbs from 'htmlbars-inline-precompile';
|
|
|
|
|
|
|
|
const TOTAL = 15;
|
2022-06-02 20:40:04 +00:00
|
|
|
const CARD_TITLE = 'Connections';
|
2020-02-13 19:44:57 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
module('Integration | Component selectable-card', function (hooks) {
|
2020-02-13 19:44:57 +00:00
|
|
|
setupRenderingTest(hooks);
|
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
hooks.beforeEach(function () {
|
2020-02-13 19:44:57 +00:00
|
|
|
this.set('total', TOTAL);
|
|
|
|
this.set('cardTitle', CARD_TITLE);
|
|
|
|
});
|
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
test('it shows the card total', async function (assert) {
|
2020-02-13 19:44:57 +00:00
|
|
|
await render(hbs`<SelectableCard @total={{total}} @cardTitle={{cardTitle}}/>`);
|
|
|
|
let titleNumber = this.element.querySelector('.title-number').innerText;
|
|
|
|
|
|
|
|
assert.equal(titleNumber, 15);
|
|
|
|
});
|
|
|
|
|
2022-06-02 20:40:04 +00:00
|
|
|
test('it returns card title, ', async function (assert) {
|
2020-02-13 19:44:57 +00:00
|
|
|
await render(hbs`<SelectableCard @total={{1}} @cardTitle={{cardTitle}}/>`);
|
|
|
|
let titleText = this.element.querySelector('.title').innerText;
|
2022-06-02 20:40:04 +00:00
|
|
|
assert.equal(titleText, 'Connections');
|
2020-02-13 19:44:57 +00:00
|
|
|
});
|
|
|
|
});
|