-
-
Notifications
You must be signed in to change notification settings - Fork 115
/
Copy pathmodule-test.js
58 lines (46 loc) · 1.85 KB
/
module-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
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import { visit, click, findAll } from '@ember/test-helpers';
module('Acceptance | Module', function (hooks) {
setupApplicationTest(hooks);
test('lists all public/private classes and namespaces on the module page', async function (assert) {
await visit('ember/1.0/modules/ember-handlebars');
const store = this.owner.lookup('service:store');
const container = store.peekRecord(
'module',
'ember-1.0.0-ember-handlebars'
);
let numberNameSpaces = Object.keys(container.get('namespaces')).length;
let numberPublicClasses = Object.keys(
container.get('publicclasses')
).length;
let numberPrivateClasses = Object.keys(
container.get('privateclasses')
).length;
assert.equal(
findAll('.spec-property-list li').length,
numberPublicClasses + numberNameSpaces
);
await click('.sidebar .private-deprecated-toggle');
assert.equal(
findAll('.spec-property-list li').length,
numberPublicClasses + numberNameSpaces + numberPrivateClasses
);
});
test('lists all submodules on the module page', async function (assert) {
await visit('ember/1.0/modules/ember');
const store = this.owner.lookup('service:store');
const container = store.peekRecord('module', 'ember-1.0.0-ember');
let numberSubModules = Object.keys(container.get('submodules')).length;
assert.equal(findAll('.spec-method-list li').length, numberSubModules);
});
test('display submodule parent', async function (assert) {
await visit('ember/1.0/modules/ember-application');
const store = this.owner.lookup('service:store');
const container = store.peekRecord(
'module',
'ember-1.0.0-ember-application'
);
assert.dom(`.attribute-value`).hasText(container.get('parent'));
});
});