-
Notifications
You must be signed in to change notification settings - Fork 2k
/
Copy pathdetail.js
64 lines (51 loc) · 1.54 KB
/
detail.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
import {
attribute,
create,
collection,
clickable,
hasClass,
isPresent,
property,
text,
visitable,
} from 'ember-cli-page-object';
import allocations from 'nomad-ui/tests/pages/components/allocations';
import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button';
export default create({
visit: visitable('/jobs/:id'),
tabs: collection('[data-test-tab]', {
id: attribute('data-test-tab'),
visit: clickable('a'),
}),
tabFor(id) {
return this.tabs.toArray().findBy('id', id);
},
stop: twoStepButton('[data-test-stop]'),
start: twoStepButton('[data-test-start]'),
execButton: {
scope: '[data-test-exec-button]',
isDisabled: property('disabled'),
hasTooltip: hasClass('tooltip'),
tooltipText: attribute('aria-label'),
},
stats: collection('[data-test-job-stat]', {
id: attribute('data-test-job-stat'),
text: text(),
}),
statFor(id) {
return this.stats.toArray().findBy('id', id);
},
childrenSummary: isPresent('[data-test-job-summary] [data-test-children-status-bar]'),
allocationsSummary: isPresent('[data-test-job-summary] [data-test-allocation-status-bar]'),
...allocations(),
viewAllAllocations: text('[data-test-view-all-allocations]'),
error: {
isPresent: isPresent('[data-test-error]'),
title: text('[data-test-error-title]'),
message: text('[data-test-error-message]'),
seekHelp: clickable('[data-test-error-message] a'),
},
recentAllocationsEmptyState: {
headline: text('[data-test-empty-recent-allocations-headline]'),
},
});