-
Notifications
You must be signed in to change notification settings - Fork 1
/
info-detail-test.js
50 lines (44 loc) · 1.13 KB
/
info-detail-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { module, test } from 'qunit';
import hbs from 'htmlbars-inline-precompile';
import { setupRenderingTest } from 'ember-qunit';
import { render, find } from '@ember/test-helpers';
import { patchReducer } from 'testing-demo/tests/helpers/vnext-patch';
const initState = {
information: {
selectedItem: 2,
all: {
1: {
id: '1',
name: 'one'
},
2: {
id: '2',
name: 'two'
}
},
configuration: {
1: {
id: '1',
column: 'id',
active: true
},
2: {
id: '2',
column: 'name',
active: true
}
}
}
};
module('Integration | Component | info detail', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function() {
patchReducer(this, initState);
});
test('should render item with all fields provided', async function(assert) {
await render(hbs`{{info-detail}}`);
assert.equal(find('[test-id=idInfo]').textContent, 'id: 2');
assert.equal(find('[test-id=nameInfo]').textContent, 'name: two');
assert.equal(find('[test-id=configureLink]').textContent, 'configure');
});
});