-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
windows_test.go
36 lines (31 loc) · 1.03 KB
/
windows_test.go
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
package biloba_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("Windows", func() {
It("has a default window size", func() {
width, height := b.WindowSize()
Ω(width).Should(Equal(1024))
Ω(height).Should(Equal(768))
Ω(`window.innerWidth`).Should(b.EvaluateTo(1024.))
Ω(`window.innerHeight`).Should(b.EvaluateTo(768.))
})
Describe("overriding window size and resetting it", Ordered, func() {
It("can override the window size", func() {
b.SetWindowSize(800, 1000)
Ω(`window.innerWidth`).Should(b.EvaluateTo(800.))
Ω(`window.innerHeight`).Should(b.EvaluateTo(1000.))
b.SetWindowSize(200, 100)
Ω(`window.innerWidth`).Should(b.EvaluateTo(200.))
Ω(`window.innerHeight`).Should(b.EvaluateTo(100.))
})
It("resets it for the next spec", func() {
width, height := b.WindowSize()
Ω(width).Should(Equal(1024))
Ω(height).Should(Equal(768))
Ω(`window.innerWidth`).Should(b.EvaluateTo(1024.))
Ω(`window.innerHeight`).Should(b.EvaluateTo(768.))
})
})
})