feat(Step): add finish-icon slot (#8241)

This commit is contained in:
neverland
2021-02-28 19:50:16 +08:00
committed by GitHub
parent ca97ef1012
commit d17e0ae9b8
5 changed files with 43 additions and 8 deletions
@@ -63,6 +63,19 @@ exports[`should change inactive icon when using inactive-icon prop 1`] = `
</div>
`;
exports[`should render finish icon slot correctly 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">
Custim Fiinsh Icon
</div>
<div class="van-step__line">
</div>
</div>
`;
exports[`should render icon slot correctly 1`] = `
<div class="van-steps van-steps--horizontal">
<div class="van-steps__items">
+16
View File
@@ -90,3 +90,19 @@ test('should change finish icon when using finish-icon prop', () => {
expect(firstStep.find('.van-icon-foo').exists()).toBeTruthy();
expect(firstStep.html()).toMatchSnapshot();
});
test('should render finish icon slot correctly', () => {
const wrapper = mount({
render() {
return (
<Steps active={1}>
<Step v-slots={{ 'finish-icon': () => `Custim Fiinsh Icon` }}>A</Step>
<Step>B</Step>
</Steps>
);
},
});
const firstStep = wrapper.find('.van-step');
expect(firstStep.html()).toMatchSnapshot();
});