-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui-test-_access.js
88 lines (64 loc) · 1.93 KB
/
ui-test-_access.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
const kDefaultPath = 'file://' + __dirname + '/ui-test-view.html';
Object.entries({
OSFeedbox: '.OSFeedbox',
OSFeedboxHeading: '.OSFeedboxHeading',
OSFeedboxButton: '.OSFeedboxButton',
OSFeedboxList: '.OSFeedboxList',
OSFeedboxListItem: '.OSFeedboxListItem',
OSFeedboxListItemBlurb: '.OSFeedboxListItemBlurb',
}).map(function (e) {
return global[e.shift()] = e.pop();
});
describe('OSFeedbox_Access', function () {
const items = Array.from(Array(uRandomInt(10))).map(function () {
return uItem({
description: null,
});
});
before(function() {
return OSVisit(kDefaultPath, {
items: JSON.stringify(items),
});
});
it('shows OSFeedbox', function () {
return browser.assert.elements(OSFeedbox, 1);
});
it('shows OSFeedboxHeading', function () {
return browser.assert.elements(OSFeedboxHeading, 1);
});
it('shows OSFeedboxButton', function () {
return browser.assert.elements(OSFeedboxButton, 1);
});
it('shows OSFeedboxList', function () {
return browser.assert.elements(OSFeedboxList, 1);
});
it('shows OSFeedboxListItem', function () {
return browser.assert.elements(OSFeedboxListItem, items.length);
});
it('hides OSFeedboxListItemBlurb', function () {
return browser.assert.elements(OSFeedboxListItemBlurb, 0);
});
context('hasBlurb', function () {
const items = Array.from(Array(uRandomInt(10))).map(uItem);
before(function() {
return OSVisit(kDefaultPath, {
items: JSON.stringify(items),
});
});
it('shows OSFeedboxListItemBlurb', function () {
return browser.assert.elements(OSFeedboxListItemBlurb, items.length);
});
});
context('hideBlurb', function () {
const items = Array.from(Array(uRandomInt(10))).map(uItem);
before(function() {
return OSVisit(kDefaultPath, {
items: JSON.stringify(items),
hideBlurb: true,
});
});
it('hides OSFeedboxListItemBlurb', function () {
return browser.assert.elements(OSFeedboxListItemBlurb, 0);
});
});
});