-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShape.tests.ps1
More file actions
81 lines (72 loc) · 3.26 KB
/
Shape.tests.ps1
File metadata and controls
81 lines (72 loc) · 3.26 KB
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
describe Shape {
it 'Makes basic shapes' {
"$(shape polygon 50% 50% 0% 100% 100% 100%)" |
Should -Be 'polygon(50% 50%, 0% 100%, 100% 100%)'
}
context 'Basic Shapes' {
it 'Can make circles' {
"$(Shape Circle 50%)" |
Should -Be 'circle(50%)'
"$(Circle 50%)" |
Should -Be 'circle(50%)'
"$(CSS.CIRCLE 50%)" |
Should -Be 'circle(50%)'
}
it 'Can make ellipses' {
"$(Shape ellipse 25% 50%)" |
Should -Be 'ellipse(25% 50%)'
"$(CSS.ELLIPSE 25% 50%)" |
Should -Be 'ellipse(25% 50%)'
"$(ellipse 4rem 50% at right center)" |
Should -Be 'ellipse(4rem 50% at right center)'
}
it 'Can make paths' {
"$(shape path m 0 0 h 100 v 100 h -100 v -100)" |
Should -Be "path('m 0 0 h 100 v 100 h -100 v -100')"
"$(path2d m 0 0 h 100 v 100 h -100 v -100)" |
Should -Be "path('m 0 0 h 100 v 100 h -100 v -100')"
"$(css.path2d m 0 0 h 100 v 100 h -100 v -100)" |
Should -Be "path('m 0 0 h 100 v 100 h -100 v -100')"
"$(css.path m 0 0 h 100 v 100 h -100 v -100)" |
Should -Be "path('m 0 0 h 100 v 100 h -100 v -100')"
}
it 'Can make polygons' {
"$(shape polygon 50% 50% 0% 100% 100% 100%)" |
Should -Be 'polygon(50% 50%, 0% 100%, 100% 100%)'
"$(POLYGON 50% 50% 0% 100% 100% 100%)" |
Should -Be 'polygon(50% 50%, 0% 100%, 100% 100%)'
"$(css.POLYGON 50% 50% 0% 100% 100% 100%)" |
Should -Be 'polygon(50% 50%, 0% 100%, 100% 100%)'
}
it 'Can make shapes' {
"$(shape nonzero from 0 0 line to 10px 10px)" |
Should -Be 'shape(nonzero from 0 0, line to 10px 10px)'
"$(Shape 'nonzero from 0 0' 'line to 10px 10px')" |
Should -Be 'shape(nonzero from 0 0, line to 10px 10px)'
"$(CSS.SHAPE 'nonzero from 0 0' 'line to 10px 10px')" |
Should -Be 'shape(nonzero from 0 0, line to 10px 10px)'
"$(css.SHAPE 'nonzero from 0 0' 'line to 10px 10px')" |
Should -Be 'shape(nonzero from 0 0, line to 10px 10px)'
}
it 'Can make insets' {
"$(shape inset 10% 20% 30% 40%)" |
Should -Be 'inset(10% 20% 30% 40%)'
"$(inset 10% 20% 30% 40%)" |
Should -Be 'inset(10% 20% 30% 40%)'
}
it 'Can make a xywh relative shape' {
"$(shape xywh 10% 20% 30% 40%)" |
Should -Be 'xywh(10% 20% 30% 40%)'
"$(xywh 10% 20% 30% 40%)" |
Should -Be 'xywh(10% 20% 30% 40%)'
}
it 'Can make rectangles' {
"$(shape Rect 0 1% auto 3% round 0 1px)" |
Should -Be 'rect(0 1% auto 3% round 0 1px)'
"$(rect 0 1% auto 3% round 0 1px)" |
Should -Be 'rect(0 1% auto 3% round 0 1px)'
"$(CSS.Rect 0 1% auto 3% round 0 1px)" |
Should -Be 'rect(0 1% auto 3% round 0 1px)'
}
}
}