chore: rename scopedSlots to slots in legacy cases

This commit is contained in:
chenjiahan 2020-11-14 06:47:08 +08:00
parent bea039c810
commit 2550ac9111
21 changed files with 41 additions and 41 deletions

View File

@ -125,7 +125,7 @@ test('columns-num prop', async () => {
test('title slot', async () => { test('title slot', async () => {
const wrapper = mount(Area, { const wrapper = mount(Area, {
scopedSlots: { slots: {
title: () => 'Custom Title', title: () => 'Custom Title',
}, },
}); });

View File

@ -302,7 +302,7 @@ test('title & footer slot', async () => {
poppable: false, poppable: false,
defaultDate: minDate, defaultDate: minDate,
}, },
scopedSlots: { slots: {
title: () => 'Custom Title', title: () => 'Custom Title',
footer: () => 'Custom Footer', footer: () => 'Custom Footer',
}, },

View File

@ -44,7 +44,7 @@ test('click-thumb event', () => {
test('render price & num slot', () => { test('render price & num slot', () => {
const wrapper = mount(Card, { const wrapper = mount(Card, {
scopedSlots: { slots: {
num: () => 'Custom Num', num: () => 'Custom Num',
price: () => 'Custom Price', price: () => 'Custom Price',
}, },
@ -55,7 +55,7 @@ test('render price & num slot', () => {
test('render origin-price slot', () => { test('render origin-price slot', () => {
const wrapper = mount(Card, { const wrapper = mount(Card, {
scopedSlots: { slots: {
'origin-price': () => 'Custom Origin Price', 'origin-price': () => 'Custom Origin Price',
}, },
}); });
@ -65,7 +65,7 @@ test('render origin-price slot', () => {
test('render bottom slot', () => { test('render bottom slot', () => {
const wrapper = mount(Card, { const wrapper = mount(Card, {
scopedSlots: { slots: {
bottom: () => 'Custom Bottom', bottom: () => 'Custom Bottom',
}, },
}); });
@ -75,7 +75,7 @@ test('render bottom slot', () => {
test('render thumb & tag slot', () => { test('render thumb & tag slot', () => {
const wrapper = mount(Card, { const wrapper = mount(Card, {
scopedSlots: { slots: {
tag: () => 'Custom Tag', tag: () => 'Custom Tag',
thumb: () => 'Custom Thumb', thumb: () => 'Custom Thumb',
}, },
@ -86,7 +86,7 @@ test('render thumb & tag slot', () => {
test('render title & desc slot', () => { test('render title & desc slot', () => {
const wrapper = mount(Card, { const wrapper = mount(Card, {
scopedSlots: { slots: {
title: () => 'Custom Title', title: () => 'Custom Title',
desc: () => 'Custom desc', desc: () => 'Custom desc',
}, },
@ -97,7 +97,7 @@ test('render title & desc slot', () => {
test('render price & price-top slot', () => { test('render price & price-top slot', () => {
const wrapper = mount(Card, { const wrapper = mount(Card, {
scopedSlots: { slots: {
price: () => 'Custom Price', price: () => 'Custom Price',
'price-top': () => 'Custom Price-top', 'price-top': () => 'Custom Price-top',
}, },

View File

@ -30,7 +30,7 @@ test('disabled', () => {
test('label disabled', () => { test('label disabled', () => {
const wrapper = mount(Checkbox, { const wrapper = mount(Checkbox, {
scopedSlots: { slots: {
default: () => 'Label', default: () => 'Label',
}, },
props: { props: {
@ -93,7 +93,7 @@ test('click event', async () => {
test('label-position prop', () => { test('label-position prop', () => {
const wrapper = mount(Checkbox, { const wrapper = mount(Checkbox, {
scopedSlots: { slots: {
default: () => 'Label', default: () => 'Label',
}, },
props: { props: {

View File

@ -108,7 +108,7 @@ test('default slot', () => {
props: { props: {
value: true, value: true,
}, },
scopedSlots: { slots: {
default: () => 'Custom Message', default: () => 'Custom Message',
}, },
}); });
@ -120,7 +120,7 @@ test('title slot', () => {
props: { props: {
value: true, value: true,
}, },
scopedSlots: { slots: {
title: () => 'Custom Title', title: () => 'Custom Title',
}, },
}); });

View File

@ -26,7 +26,7 @@ test('click-input event', () => {
test('click-input event when using input slot', () => { test('click-input event when using input slot', () => {
const wrapper = mount(Field, { const wrapper = mount(Field, {
scopedSlots: { slots: {
input: () => 'Custom Input', input: () => 'Custom Input',
}, },
}); });
@ -224,7 +224,7 @@ test('clear-trigger prop', () => {
test('render input slot', () => { test('render input slot', () => {
const wrapper = mount(Field, { const wrapper = mount(Field, {
scopedSlots: { slots: {
input: () => 'Custom Input', input: () => 'Custom Input',
}, },
}); });
@ -234,7 +234,7 @@ test('render input slot', () => {
test('render label slot', () => { test('render label slot', () => {
const wrapper = mount(Field, { const wrapper = mount(Field, {
scopedSlots: { slots: {
label: () => 'Custom Label', label: () => 'Custom Label',
}, },
}); });
@ -244,7 +244,7 @@ test('render label slot', () => {
test('render extra slot', () => { test('render extra slot', () => {
const wrapper = mount(Field, { const wrapper = mount(Field, {
scopedSlots: { slots: {
extra: () => 'Extra', extra: () => 'Extra',
}, },
}); });

View File

@ -188,7 +188,7 @@ test('default slot', () => {
props: { props: {
src: 'https://img.yzcdn.cn/vant/cat.jpeg', src: 'https://img.yzcdn.cn/vant/cat.jpeg',
}, },
scopedSlots: { slots: {
default: () => 'Custom Default', default: () => 'Custom Default',
}, },
}); });

View File

@ -75,7 +75,7 @@ test('finished slot', async () => {
props: { props: {
finished: true, finished: true,
}, },
scopedSlots: { slots: {
finished: () => 'Custom Finished', finished: () => 'Custom Finished',
}, },
}); });
@ -88,7 +88,7 @@ test('error slot', async () => {
props: { props: {
error: true, error: true,
}, },
scopedSlots: { slots: {
error: () => 'Custom Error', error: () => 'Custom Error',
}, },
}); });

View File

@ -16,7 +16,7 @@ test('text-size prop', () => {
props: { props: {
textSize: 20, textSize: 20,
}, },
scopedSlots: { slots: {
default: () => 'Text', default: () => 'Text',
}, },
}); });

View File

@ -3,7 +3,7 @@ import { mount, mockGetBoundingClientRect } from '../../../test';
test('should render left/right slot and match snapshot', () => { test('should render left/right slot and match snapshot', () => {
const wrapper = mount(NavBar, { const wrapper = mount(NavBar, {
scopedSlots: { slots: {
left: () => 'Custom Left', left: () => 'Custom Left',
right: () => 'Custom Right', right: () => 'Custom Right',
}, },
@ -14,7 +14,7 @@ test('should render left/right slot and match snapshot', () => {
test('should render title slot and match snapshot', () => { test('should render title slot and match snapshot', () => {
const wrapper = mount(NavBar, { const wrapper = mount(NavBar, {
scopedSlots: { slots: {
title: () => 'Custom Title', title: () => 'Custom Title',
}, },
}); });

View File

@ -85,7 +85,7 @@ test('render title', () => {
test('title-left slot', () => { test('title-left slot', () => {
const wrapper = mount(NumberKeyboard, { const wrapper = mount(NumberKeyboard, {
scopedSlots: { slots: {
'title-left': () => 'Custom Title Left', 'title-left': () => 'Custom Title Left',
}, },
}); });
@ -105,7 +105,7 @@ test('extra-key prop', () => {
test('extra-key slot', () => { test('extra-key slot', () => {
const wrapper = mount(NumberKeyboard, { const wrapper = mount(NumberKeyboard, {
scopedSlots: { slots: {
'extra-key': () => 'Custom Extra Key', 'extra-key': () => 'Custom Extra Key',
}, },
}); });

View File

@ -63,7 +63,7 @@ test('click event', () => {
test('default slot', () => { test('default slot', () => {
const wrapper = mount(Overlay, { const wrapper = mount(Overlay, {
scopedSlots: { slots: {
default: () => 'Custom Default', default: () => 'Custom Default',
}, },
}); });

View File

@ -7,7 +7,7 @@ test('render prev-text & next-text slot', () => {
totalItems: 50, totalItems: 50,
showPageSize: 5, showPageSize: 5,
}, },
scopedSlots: { slots: {
'prev-text': () => 'Custom PrevText', 'prev-text': () => 'Custom PrevText',
'next-text': () => 'Custom NextText', 'next-text': () => 'Custom NextText',
}, },
@ -22,7 +22,7 @@ test('render page slot', () => {
totalItems: 50, totalItems: 50,
showPageSize: 5, showPageSize: 5,
}, },
scopedSlots: { slots: {
page: ({ text }) => `${text}`, page: ({ text }) => `${text}`,
}, },
}); });

View File

@ -261,7 +261,7 @@ test('columns-top、columns-bottom prop', () => {
props: { props: {
showToolbar: true, showToolbar: true,
}, },
scopedSlots: { slots: {
'columns-top': () => 'Custom Columns Top', 'columns-top': () => 'Custom Columns Top',
'columns-bottom': () => 'Custom Columns Bottom', 'columns-bottom': () => 'Custom Columns Bottom',
}, },

View File

@ -45,7 +45,7 @@ test('change head content when pulling down', async () => {
test('custom content by slots', async () => { test('custom content by slots', async () => {
const wrapper = mount(PullRefresh, { const wrapper = mount(PullRefresh, {
scopedSlots: { slots: {
pulling({ distance }) { pulling({ distance }) {
return `pulling ${distance}`; return `pulling ${distance}`;
}, },
@ -137,7 +137,7 @@ test('render success text', async () => {
test('render success slot', async () => { test('render success slot', async () => {
const wrapper = mount(PullRefresh, { const wrapper = mount(PullRefresh, {
scopedSlots: { slots: {
success: () => 'Custom Success', success: () => 'Custom Success',
}, },
listeners: { listeners: {

View File

@ -65,7 +65,7 @@ test('search event', () => {
test('label slot', () => { test('label slot', () => {
const wrapper = mount(Search, { const wrapper = mount(Search, {
scopedSlots: { slots: {
label: () => 'Custom Label', label: () => 'Custom Label',
}, },
}); });
@ -75,7 +75,7 @@ test('label slot', () => {
test('left slot', () => { test('left slot', () => {
const wrapper = mount(Search, { const wrapper = mount(Search, {
scopedSlots: { slots: {
left: () => 'Custom Left Content', left: () => 'Custom Left Content',
}, },
}); });
@ -105,7 +105,7 @@ test('right-icon prop', () => {
test('right-icon slot', () => { test('right-icon slot', () => {
const wrapper = mount(Search, { const wrapper = mount(Search, {
scopedSlots: { slots: {
'right-icon': () => 'Custom Right Icon', 'right-icon': () => 'Custom Right Icon',
}, },
}); });

View File

@ -75,7 +75,7 @@ test('title & description slot', () => {
props: { props: {
value: true, value: true,
}, },
scopedSlots: { slots: {
title: () => 'Custom Title', title: () => 'Custom Title',
description: () => 'Custom Description', description: () => 'Custom Description',
}, },

View File

@ -51,7 +51,7 @@ test('without price', () => {
test('top slot', () => { test('top slot', () => {
const wrapper = mount(SubmitBar, { const wrapper = mount(SubmitBar, {
scopedSlots: { slots: {
top: () => 'Custom Top', top: () => 'Custom Top',
}, },
}); });
@ -123,7 +123,7 @@ test('button-color prop', () => {
test('button slot', () => { test('button slot', () => {
const wrapper = mount(SubmitBar, { const wrapper = mount(SubmitBar, {
buttonText: 'text', buttonText: 'text',
scopedSlots: { slots: {
button: () => 'Custom button', button: () => 'Custom button',
}, },
}); });

View File

@ -12,7 +12,7 @@ const defaultProps = {
leftWidth: 100, leftWidth: 100,
rightWidth: 100, rightWidth: 100,
}, },
scopedSlots: { slots: {
left: () => 'Left', left: () => 'Left',
right: () => 'Right', right: () => 'Right',
}, },
@ -120,7 +120,7 @@ test('auto calc width', async () => {
}); });
const wrapper = mount(SwipeCell, { const wrapper = mount(SwipeCell, {
scopedSlots: defaultProps.scopedSlots, slots: defaultProps.scopedSlots,
}); });
await later(); await later();
@ -136,7 +136,7 @@ test('render one side', async () => {
}); });
const wrapper = mount(SwipeCell, { const wrapper = mount(SwipeCell, {
scopedSlots: { slots: {
left: defaultProps.scopedSlots.left, left: defaultProps.scopedSlots.left,
}, },
}); });

View File

@ -127,7 +127,7 @@ test('content slot', () => {
}, },
], ],
}, },
scopedSlots: { slots: {
content: () => 'Custom Content', content: () => 'Custom Content',
}, },
}); });

View File

@ -530,7 +530,7 @@ test('preview-cover slot', () => {
props: { props: {
fileList: [{ url: IMAGE }, { url: IMAGE }], fileList: [{ url: IMAGE }, { url: IMAGE }],
}, },
scopedSlots: { slots: {
'preview-cover': (item) => `url: ${item.url}, index: ${item.index}`, 'preview-cover': (item) => `url: ${item.url}, index: ${item.index}`,
}, },
}); });