-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathsimple-test.js
99 lines (93 loc) · 3.21 KB
/
simple-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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* global capture */
/* eslint-disable no-console */
import {
expect
} from 'chai'
import {
describeComponent,
it
} from 'ember-mocha'
import hbs from 'htmlbars-inline-precompile'
describeComponent(
'frost-button',
'Integration: FrostButtonComponent', {
integration: true
},
function () {
it('renders', function (done) {
this.timeout(30000)
this.render(hbs `<div id='test'>Test</div>`)
expect(this.$()).to.have.length(1)
capture('Simple', done)
})
it('renders something else', function (done) {
this.timeout(30000)
this.render(hbs `<div id='test'>Test Else</div>`)
expect(this.$()).to.have.length(1)
capture('Error', done)
})
it('renders svg', function (done) {
this.timeout(30000)
/* eslint-disable max-len */
this.render(hbs `<svg id="mySVG"xmlns="http://www.w3.org/2000/svg" viewBox="-350 -250 700 500">
<style type="text/css" media="screen">
svg { background:#fff; }
.face { stroke:#000; stroke-width:20px; stroke-linecap:round }
</style>
<circle r="200" class="face" fill="red"/>
<path fill="none" class="face" transform="translate(-396,-230)" d="M487,282c-15,36-51,62-92,62 c-41,0-77-25-92-61"/>
<circle cx="-60" cy="-50" r="20" fill="#000"/>
<circle cx="60" cy="-50" r="20" fill="#000"/>
</svg>`)
/* eslint-enable max-len */
capture('svg', done)
})
it('renders svg experimental', function (done) {
this.timeout(30000)
/* eslint-disable max-len */
this.render(hbs `<svg id="mySVG"xmlns="http://www.w3.org/2000/svg" viewBox="-350 -250 700 500">
<style type="text/css" media="screen">
svg { background:#fff; }
.face { stroke:#000; stroke-width:20px; stroke-linecap:round }
</style>
<circle r="200" class="face" fill="red"/>
<path fill="none" class="face" transform="translate(-396,-230)" d="M487,282c-15,36-51,62-92,62 c-41,0-77-25-92-61"/>
<circle cx="-60" cy="-50" r="20" fill="#000"/>
<circle cx="60" cy="-50" r="20" fill="#000"/>
</svg>`)
/* eslint-enable max-len */
capture('svg-experimental', done, {experimentalSvgs: true})
})
it('captures target', function (done) {
this.timeout(30000)
/* eslint-disable max-len */
this.render(hbs `<div class="outer">
<div class="innerdivs left">
Left Div
</div>
<div class="innerdivs right">
Center Div
</div>
<div class="innerdivs center">
Right Div
</div>
</div>`)
/* eslint-enable max-len */
capture('capture right', done, {targetElement: document.getElementsByClassName('innerdivs')[2]})
})
it('fixed div', function (done) {
this.timeout(30000)
this.render(hbs `<div class="fixed">Wherever you go, I will find you!</div>`)
capture('fixed', done)
})
it('more fixed', function (done) {
this.timeout(10000)
this.render(hbs `<div id="left">Side menu</div>
<div id="right">Top Menu
<br />Top Menu
<br />Top Menu
</div>`)
capture('fixed-more', done, {width: 1920, height: 1080})
})
}
)