-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdata-table-row-current-test.js
65 lines (61 loc) · 2.1 KB
/
data-table-row-current-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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { module, skip } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { run } from '@ember/runloop';
import hbs from 'htmlbars-inline-precompile';
module('Integration | Component | data-table-row-current', function(hooks) {
setupRenderingTest(hooks);
skip('it renders change percent of 0 as 0.0%', async function(assert) {
const store = this.owner.lookup('service:store');
const model = await store.createRecord('acs-row', {
id: 'TGdNS2htMVkyMDEyLTIwMTY=',
base: 'LgMKhm1',
variablename: 'LgMKhm1',
category: 'languageSpokenAtHome',
dataset: 'y2014_2018',
profile: 'social',
variable: 'lgmkhm1',
is_most_recent: true,
sum: 0,
marginOfError: null,
correlationCoefficient: null,
percent: null,
previousPercent: null,
previousSum: 0,
previousMarginOfError: null,
percentMarginOfError: null,
previousPercentMarginOfError: null,
comparisonCorrelationCoefficient: 62.8,
comparisonMarginOfError: 32,
comparisonSum: 31,
comparisonPercentMarginOfError: null,
comparisonPercent: 1,
changeSum: 0,
changeMarginOfError: 0,
changePercent: null,
changePercentMarginOfError: null,
significant: false,
percentSignificant: true,
differenceSum: -31,
differencePercent: -100,
differenceMarginOfError: 32,
differencePercentMarginOfError: 0,
changePercentagePoint: '0',
changePercentagePointMarginOfError: 0,
changeSignificant: false,
changePercentSignificant: false,
changepercentagePointSignificant: false,
rowConfig:
{ title: 'Mon-Khmer, Cambodian',
highlight: true,
variable: 'lgmkhm1' },
special: false,
numGeoids: 9,
codingThresholds: {},
isReliable: false,
comparisonIsReliable: false });
this.set('data', model);
await render(hbs`{{data-table-row-current data=data}}`);
assert.equal(this.element.querySelector('td.difference-percent').textContent.trim(), '-100.0');
});
});