032ffcaff2
* fix linting errors * don't show primary url if we don't have any primaries * Revert "fix linting errors" This reverts commit a56d371272868d93024c557a6d5807be6eadda57. * run all component tests always
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
import { module, test } from 'qunit';
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
import { render } from '@ember/test-helpers';
|
|
import hbs from 'htmlbars-inline-precompile';
|
|
|
|
const TITLE = 'My Table';
|
|
const HEADER = 'Cool Header';
|
|
const ITEMS = ['https://127.0.0.1:8201', 'hello', 3];
|
|
|
|
module('Integration | Component | InfoTable', function(hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
hooks.beforeEach(function() {
|
|
this.set('title', TITLE);
|
|
this.set('header', HEADER);
|
|
this.set('items', ITEMS);
|
|
});
|
|
|
|
test('it renders', async function(assert) {
|
|
await render(hbs`<InfoTable
|
|
@title={{title}}
|
|
@header={{header}}
|
|
@items={{items}}
|
|
/>`);
|
|
|
|
assert.dom('[data-test-info-table]').exists();
|
|
assert.dom('[data-test-info-table] th').includesText(HEADER, `shows the table header`);
|
|
|
|
const rows = document.querySelectorAll('.info-table-row');
|
|
assert.equal(rows.length, ITEMS.length, 'renders an InfoTableRow for each item');
|
|
|
|
rows.forEach((row, i) => {
|
|
assert.equal(row.innerText, ITEMS[i], 'handles strings and numbers as row values');
|
|
});
|
|
});
|
|
});
|