forked from Happy-Coding-Clans/vue-easytable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathve-locale.spec.js
63 lines (53 loc) · 1.65 KB
/
ve-locale.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { mount } from "@vue/test-utils";
import veLocale from "@/ve-locale";
import { later } from "../util";
import zhCN from "@/src/locale/lang/zh-CN";
import enUS from "@/src/locale/lang/en-US";
describe("veLocale", () => {
const wrapper = mount({
render() {
return (
<div>
<ve-pagination total={600} />
<ve-pagination total={600} pageIndex={2} />
<ve-pagination total={600} pageIndex={30} />
<ve-pagination
total={600}
layout={["total", "prev", "next", "sizer", "jumper"]}
/>
<ve-pagination
total={600}
layout={[
"total",
"sizer",
"prev",
"pager",
"next",
"jumper",
]}
/>
</div>
);
},
});
it("render with zhCN", async () => {
veLocale.use(zhCN);
await later();
expect(wrapper.html()).toMatchSnapshot();
});
it("render with enUS", async () => {
veLocale.use(enUS);
await later();
expect(wrapper.html()).toMatchSnapshot();
});
it("render by update method", async () => {
const lang = {
pagination: {
goto: "跳转到",
},
};
veLocale.update(lang);
await later();
expect(wrapper.html()).toMatchSnapshot();
});
});