mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
test(Pagination): update test cases
This commit is contained in:
parent
e46fb0fb7a
commit
669d2e77ae
@ -1,25 +1,53 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`render page slot 1`] = `
|
exports[`should render page slot correctly 1`] = `
|
||||||
<ul class="van-pagination">
|
<ul class="van-pagination">
|
||||||
<li class="van-pagination__item van-pagination__prev van-hairline">上一页</li>
|
<li class="van-pagination__item van-pagination__prev van-hairline">
|
||||||
<li class="van-pagination__item van-pagination__page van-hairline">1</li>
|
上一页
|
||||||
<li class="van-pagination__item van-pagination__page van-hairline">2</li>
|
</li>
|
||||||
<li class="van-pagination__item van-pagination__page van-hairline">3</li>
|
<li class="van-pagination__item van-pagination__page van-hairline">
|
||||||
<li class="van-pagination__item van-pagination__page van-hairline">4</li>
|
foo 1
|
||||||
<li class="van-pagination__item van-pagination__page van-hairline">5</li>
|
</li>
|
||||||
<li class="van-pagination__item van-pagination__next van-hairline">下一页</li>
|
<li class="van-pagination__item van-pagination__page van-hairline">
|
||||||
|
foo 2
|
||||||
|
</li>
|
||||||
|
<li class="van-pagination__item van-pagination__page van-hairline">
|
||||||
|
foo 3
|
||||||
|
</li>
|
||||||
|
<li class="van-pagination__item van-pagination__page van-hairline">
|
||||||
|
foo 4
|
||||||
|
</li>
|
||||||
|
<li class="van-pagination__item van-pagination__page van-hairline">
|
||||||
|
foo 5
|
||||||
|
</li>
|
||||||
|
<li class="van-pagination__item van-pagination__next van-hairline">
|
||||||
|
下一页
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`render prev-text & next-text slot 1`] = `
|
exports[`should render prev-text、next-text slot correctly 1`] = `
|
||||||
<ul class="van-pagination">
|
<ul class="van-pagination">
|
||||||
<li class="van-pagination__item van-pagination__prev van-hairline">Custom PrevText</li>
|
<li class="van-pagination__item van-pagination__prev van-hairline">
|
||||||
<li class="van-pagination__item van-pagination__page van-hairline">1</li>
|
Custom PrevText
|
||||||
<li class="van-pagination__item van-pagination__page van-hairline">2</li>
|
</li>
|
||||||
<li class="van-pagination__item van-pagination__page van-hairline">3</li>
|
<li class="van-pagination__item van-pagination__page van-hairline">
|
||||||
<li class="van-pagination__item van-pagination__page van-hairline">4</li>
|
1
|
||||||
<li class="van-pagination__item van-pagination__page van-hairline">5</li>
|
</li>
|
||||||
<li class="van-pagination__item van-pagination__next van-hairline">Custom NextText</li>
|
<li class="van-pagination__item van-pagination__page van-hairline">
|
||||||
|
2
|
||||||
|
</li>
|
||||||
|
<li class="van-pagination__item van-pagination__page van-hairline">
|
||||||
|
3
|
||||||
|
</li>
|
||||||
|
<li class="van-pagination__item van-pagination__page van-hairline">
|
||||||
|
4
|
||||||
|
</li>
|
||||||
|
<li class="van-pagination__item van-pagination__page van-hairline">
|
||||||
|
5
|
||||||
|
</li>
|
||||||
|
<li class="van-pagination__item van-pagination__next van-hairline">
|
||||||
|
Custom NextText
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
`;
|
`;
|
@ -1,7 +1,7 @@
|
|||||||
import { mount } from '@vue/test-utils';
|
import { mount } from '@vue/test-utils';
|
||||||
import Paginaion from '..';
|
import Paginaion from '..';
|
||||||
|
|
||||||
test('render prev-text & next-text slot', () => {
|
test('should render prev-text、next-text slot correctly', () => {
|
||||||
const wrapper = mount(Paginaion, {
|
const wrapper = mount(Paginaion, {
|
||||||
props: {
|
props: {
|
||||||
totalItems: 50,
|
totalItems: 50,
|
||||||
@ -16,14 +16,14 @@ test('render prev-text & next-text slot', () => {
|
|||||||
expect(wrapper.html()).toMatchSnapshot();
|
expect(wrapper.html()).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('render page slot', () => {
|
test('should render page slot correctly', () => {
|
||||||
const wrapper = mount(Paginaion, {
|
const wrapper = mount(Paginaion, {
|
||||||
props: {
|
props: {
|
||||||
totalItems: 50,
|
totalItems: 50,
|
||||||
showPageSize: 5,
|
showPageSize: 5,
|
||||||
},
|
},
|
||||||
slots: {
|
slots: {
|
||||||
page: ({ text }) => `${text}`,
|
page: ({ text }) => `foo ${text}`,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user