@@ -3,7 +3,7 @@ import CircleContainer from "@/components/Circle/CircleContainer.vue";
3
3
import Gradient from "@/components/Gradient.vue" ;
4
4
import { factory } from "@/../tests/helper" ;
5
5
6
- const localFactory = ( colorObject ) => factory ( { container : CircleContainer , props : colorObject } ) ;
6
+ const localFactory = ( props ) => factory ( { container : CircleContainer , props } ) ;
7
7
8
8
const gradientColor = {
9
9
radial : false ,
@@ -21,9 +21,9 @@ const gradientColor = {
21
21
] ,
22
22
} ;
23
23
24
- const colorAsStringTests = ( colorProp , color , selector , fill = false ) => {
24
+ const colorAsStringTests = ( colorProp , color , selector , fill = false , half ) => {
25
25
describe ( "applies color as string" , ( ) => {
26
- const wrapper = localFactory ( { ...colorProp } ) ;
26
+ const wrapper = localFactory ( { ...colorProp , half } ) ;
27
27
const circleWrapper = wrapper . find ( selector ) ;
28
28
29
29
it ( "do not recognize gradient colors" , ( ) => {
@@ -42,9 +42,9 @@ const colorAsStringTests = (colorProp, color, selector, fill = false) => {
42
42
} ) ;
43
43
} ;
44
44
45
- const gradientColorTests = ( colorProp , selector , gradientURLPrefix , fill = false ) => {
45
+ const gradientColorTests = ( colorProp , selector , gradientURLPrefix , fill = false , half ) => {
46
46
describe ( "applies gradient color correctly" , ( ) => {
47
- const wrapper = localFactory ( colorProp ) ;
47
+ const wrapper = localFactory ( { ... colorProp , half } ) ;
48
48
const circleWrapper = wrapper . find ( selector ) ;
49
49
const id = 0 ;
50
50
const stopColorWrappers = wrapper . findAll ( "stop" ) ;
@@ -90,14 +90,14 @@ const colorTests = (colorProp, half = false, empty = false, gradientURLPrefix) =
90
90
91
91
it ( "does not render fill circle" , ( ) => {
92
92
expect (
93
- localFactory ( { [ colorProp ] : color } )
93
+ localFactory ( { [ colorProp ] : color , half } )
94
94
. find ( `.ep-${ half ? "half-" : "" } circle--${ empty ? "empty" : "progress" } __fill` )
95
95
. exists ( )
96
96
) . to . be . false ;
97
97
} ) ;
98
98
99
- colorAsStringTests ( { [ colorProp ] : color } , color , circleSelector , false ) ;
100
- gradientColorTests ( { [ colorProp ] : gradientColor } , circleSelector , gradientURLPrefix , false ) ;
99
+ colorAsStringTests ( { [ colorProp ] : color } , color , circleSelector , false , half ) ;
100
+ gradientColorTests ( { [ colorProp ] : gradientColor } , circleSelector , gradientURLPrefix , false , half ) ;
101
101
} ;
102
102
103
103
const colorFillTests = ( colorProp , half = false , empty = false , gradientURLPrefix ) => {
@@ -109,14 +109,14 @@ const colorFillTests = (colorProp, half = false, empty = false, gradientURLPrefi
109
109
110
110
it ( "renders fill circle" , ( ) => {
111
111
expect (
112
- localFactory ( { [ colorProp ] : color } )
112
+ localFactory ( { [ colorProp ] : color , half } )
113
113
. find ( circleSelector )
114
114
. exists ( )
115
115
) . to . be . true ;
116
116
} ) ;
117
117
118
- colorAsStringTests ( { [ colorProp ] : color } , color , circleSelector , true ) ;
119
- gradientColorTests ( { [ colorProp ] : gradientColor } , circleSelector , gradientURLPrefix , true ) ;
118
+ colorAsStringTests ( { [ colorProp ] : color } , color , circleSelector , true , half ) ;
119
+ gradientColorTests ( { [ colorProp ] : gradientColor } , circleSelector , gradientURLPrefix , true , half ) ;
120
120
} ;
121
121
122
122
describe ( "Colors" , ( ) => {
0 commit comments