[new feature] Toast: add iconPrefix option (#3872)

This commit is contained in:
neverland
2019-07-17 10:34:02 +08:00
committed by GitHub
parent e653484f39
commit 1c09a44751
6 changed files with 24 additions and 2 deletions
@@ -12,6 +12,13 @@ exports[`icon prop 1`] = `
</div>
`;
exports[`icon-prefix prop 1`] = `
<div class="van-toast van-toast--middle" style="z-index: 2005;" name="van-fade"><i class="my-icon my-icon-star-o van-toast__icon">
<!----></i>
<div class="van-toast__text">Message</div>
</div>
`;
exports[`show html toast 1`] = `
<div class="van-toast van-toast--middle van-toast--text" style="z-index: 2003;" name="van-fade">
<div class="van-toast__text">
+11
View File
@@ -60,6 +60,17 @@ test('icon prop', async () => {
expect(toast.$el.outerHTML).toMatchSnapshot();
});
test('icon-prefix prop', async () => {
const toast = Toast({
message: 'Message',
icon: 'star-o',
iconPrefix: 'my-icon'
});
await later();
expect(toast.$el.outerHTML).toMatchSnapshot();
});
test('clear toast', () => {
const toast1 = Toast();
expect(toast1.value).toBeTruthy();