vant/src/pagination/test/index.legacy.js
2020-11-08 20:03:39 +08:00

32 lines
651 B
JavaScript

import { mount } from '../../../test';
import Paginaion from '..';
test('render prev-text & next-text slot', () => {
const wrapper = mount(Paginaion, {
propsData: {
totalItems: 50,
showPageSize: 5,
},
scopedSlots: {
'prev-text': () => 'Custom PrevText',
'next-text': () => 'Custom NextText',
},
});
expect(wrapper.html()).toMatchSnapshot();
});
test('render page slot', () => {
const wrapper = mount(Paginaion, {
propsData: {
totalItems: 50,
showPageSize: 5,
},
scopedSlots: {
page: ({ text }) => `${text}`,
},
});
expect(wrapper.html()).toMatchSnapshot();
});