mirror of
https://github.com/youzan/vant.git
synced 2025-10-25 20:55:47 +00:00
[new feature] Toast: add icon prop (#3485)
This commit is contained in:
@@ -11,6 +11,7 @@ test('create a forbidClick toast', async () => {
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
await later();
|
||||
expect(toast.$el.outerHTML).toMatchSnapshot();
|
||||
|
||||
await later();
|
||||
@@ -30,6 +31,35 @@ it('toast disappeared after duration', async () => {
|
||||
expect(toast.$el.style.display).toEqual('none');
|
||||
});
|
||||
|
||||
test('show loading toast', async () => {
|
||||
const toast = Toast.loading({
|
||||
message: 'Message'
|
||||
});
|
||||
|
||||
await later();
|
||||
expect(toast.$el.outerHTML).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('show html toast', async () => {
|
||||
const toast = Toast({
|
||||
type: 'html',
|
||||
message: '<div>Message</div>'
|
||||
});
|
||||
|
||||
await later();
|
||||
expect(toast.$el.outerHTML).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('icon prop', async () => {
|
||||
const toast = Toast({
|
||||
message: 'Message',
|
||||
icon: 'star-o'
|
||||
});
|
||||
|
||||
await later();
|
||||
expect(toast.$el.outerHTML).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('clear toast', () => {
|
||||
const toast1 = Toast();
|
||||
expect(toast1.value).toBeTruthy();
|
||||
|
||||
Reference in New Issue
Block a user