feat(Steps): add finish-icon prop (#8103)
This commit is contained in:
@@ -1,5 +1,19 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`should change finish icon when using finish-icon prop 1`] = `
|
||||
<div class="van-hairline van-step van-step--horizontal van-step--finish">
|
||||
<div class="van-step__title">
|
||||
A
|
||||
</div>
|
||||
<div class="van-step__circle-container">
|
||||
<i class="van-badge__wrapper van-icon van-icon-foo van-step__icon van-step__icon--finish">
|
||||
</i>
|
||||
</div>
|
||||
<div class="van-step__line">
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`should change inactive color when using inactive-color prop 1`] = `
|
||||
<div class="van-steps van-steps--horizontal">
|
||||
<div class="van-steps__items">
|
||||
@@ -38,30 +52,15 @@ exports[`should change inactive color when using inactive-color prop 1`] = `
|
||||
`;
|
||||
|
||||
exports[`should change inactive icon when using inactive-icon prop 1`] = `
|
||||
<div class="van-steps van-steps--horizontal">
|
||||
<div class="van-steps__items">
|
||||
<div class="van-hairline van-step van-step--horizontal van-step--process">
|
||||
<div class="van-step__title van-step__title--active">
|
||||
A
|
||||
</div>
|
||||
<div class="van-step__circle-container">
|
||||
<i class="van-badge__wrapper van-icon van-icon-checked van-step__icon van-step__icon--active">
|
||||
</i>
|
||||
</div>
|
||||
<div class="van-step__line">
|
||||
</div>
|
||||
</div>
|
||||
<div class="van-hairline van-step van-step--horizontal">
|
||||
<div class="van-step__title">
|
||||
B
|
||||
</div>
|
||||
<div class="van-step__circle-container">
|
||||
<i class="van-badge__wrapper van-icon van-icon-foo van-step__icon">
|
||||
</i>
|
||||
</div>
|
||||
<div class="van-step__line">
|
||||
</div>
|
||||
</div>
|
||||
<div class="van-hairline van-step van-step--horizontal">
|
||||
<div class="van-step__title">
|
||||
B
|
||||
</div>
|
||||
<div class="van-step__circle-container">
|
||||
<i class="van-badge__wrapper van-icon van-icon-foo van-step__icon">
|
||||
</i>
|
||||
</div>
|
||||
<div class="van-step__line">
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -68,5 +68,25 @@ test('should change inactive icon when using inactive-icon prop', () => {
|
||||
);
|
||||
},
|
||||
});
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
|
||||
const steps = wrapper.findAll('.van-step');
|
||||
expect(steps[1].find('.van-icon-foo').exists()).toBeTruthy();
|
||||
expect(steps[1].html()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should change finish icon when using finish-icon prop', () => {
|
||||
const wrapper = mount({
|
||||
render() {
|
||||
return (
|
||||
<Steps active={1} finishIcon="foo">
|
||||
<Step>A</Step>
|
||||
<Step>B</Step>
|
||||
</Steps>
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
const firstStep = wrapper.find('.van-step');
|
||||
expect(firstStep.find('.van-icon-foo').exists()).toBeTruthy();
|
||||
expect(firstStep.html()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user