forked from EnergySage/es-ds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEsPagination.spec.js
40 lines (37 loc) · 1.19 KB
/
EsPagination.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { mount } from '@vue/test-utils';
import EsPagination from '@/src/lib-components/EsPagination.vue';
import jestVue from '@/tests/jest.vue.config';
describe('EsPagination', () => {
test('<EsPagination />', async () => {
const TestComponent = {
components: {
EsPagination,
},
template: `
<div>
<ul id="paginated-list">
<li>Item 1</li>
<li>Item 2</li>
</ul>
<EsPagination
v-model="currentPage"
:total-rows="2"
:per-page="1"
listId="paginated-list" />
</div>
`,
data() {
return {
currentPage: 1,
};
},
};
const wrapper = mount(TestComponent, {
...jestVue,
});
expect(wrapper.vm).toBeTruthy();
expect(wrapper.html()).toMatchSnapshot();
// Note: a11y test removed due to possible false negative on bs-vue pagination;
// re-evaluate after further a11y audits
});
});