Skip to content

Commit 0946c4b

Browse files
committed
fix: update test
1 parent 6ea5f29 commit 0946c4b

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

src/packages/price/__test__/__snapshots__/price.spec.tsx.snap

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,54 @@ exports[`props test 1`] = `
8282
</div>
8383
`;
8484

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+
85133
exports[`props thousands test 1`] = `
86134
<div>
87135
<div
@@ -110,3 +158,27 @@ exports[`props thousands test 1`] = `
110158
</div>
111159
</div>
112160
`;
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+
`;

src/packages/price/__test__/price.spec.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,15 @@ test('props digits test', () => {
3939
)
4040
expect(container).toMatchSnapshot()
4141
})
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+
})

0 commit comments

Comments
 (0)