File tree Expand file tree Collapse file tree 2 files changed +84
-0
lines changed
src/packages/price/__test__ Expand file tree Collapse file tree 2 files changed +84
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,54 @@ exports[`props test 1`] = `
82
82
</div >
83
83
` ;
84
84
85
+ exports [` props test 2` ] = `
86
+ <div >
87
+ <div
88
+ class = " nut-price nut-price-primary "
89
+ >
90
+ <div
91
+ class = " nut-price-integer nut-price-integer-normal "
92
+ >
93
+ 1,010
94
+ </div >
95
+ <div
96
+ class = " nut-price-decimal nut-price-decimal-normal "
97
+ >
98
+ .
99
+ </div >
100
+ <div
101
+ class = " nut-price-decimal nut-price-decimal-normal "
102
+ >
103
+ 00
104
+ </div >
105
+ </div >
106
+ </div >
107
+ ` ;
108
+
109
+ exports [` props test 3` ] = `
110
+ <div >
111
+ <div
112
+ class = " nut-price nut-price-primary "
113
+ >
114
+ <div
115
+ class = " nut-price-integer nut-price-integer-normal "
116
+ >
117
+ 1,010
118
+ </div >
119
+ <div
120
+ class = " nut-price-decimal nut-price-decimal-normal "
121
+ >
122
+ .
123
+ </div >
124
+ <div
125
+ class = " nut-price-decimal nut-price-decimal-normal "
126
+ >
127
+ 00
128
+ </div >
129
+ </div >
130
+ </div >
131
+ ` ;
132
+
85
133
exports [` props thousands test 1` ] = `
86
134
<div >
87
135
<div
@@ -110,3 +158,27 @@ exports[`props thousands test 1`] = `
110
158
</div >
111
159
</div >
112
160
` ;
161
+
162
+ exports [` props type 1` ] = `
163
+ <div >
164
+ <div
165
+ class = " nut-price nut-price-primary "
166
+ >
167
+ <div
168
+ class = " nut-price-integer nut-price-integer-normal "
169
+ >
170
+ 1,010
171
+ </div >
172
+ <div
173
+ class = " nut-price-decimal nut-price-decimal-normal "
174
+ >
175
+ .
176
+ </div >
177
+ <div
178
+ class = " nut-price-decimal nut-price-decimal-normal "
179
+ >
180
+ 00
181
+ </div >
182
+ </div >
183
+ </div >
184
+ ` ;
Original file line number Diff line number Diff line change @@ -39,3 +39,15 @@ test('props digits test', () => {
39
39
)
40
40
expect ( container ) . toMatchSnapshot ( )
41
41
} )
42
+
43
+ test ( 'props size' , ( ) => {
44
+ const { container } = render ( < Price price = { 1010 } size = "large" /> )
45
+ expect ( container . querySelector ( '.nut-price-integer' ) ) . toHaveClass (
46
+ 'nut-price-integer-large'
47
+ )
48
+ } )
49
+
50
+ test ( 'props type' , ( ) => {
51
+ const { container } = render ( < Price price = { 1010 } type = "primary" /> )
52
+ expect ( container . querySelector ( '.nut-price' ) ) . toHaveClass ( 'nut-price-primary' )
53
+ } )
You can’t perform that action at this time.
0 commit comments