vue2-client 1.15.12 → 1.15.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/test/Amis.spec.js DELETED
@@ -1,164 +0,0 @@
1
- import { mount } from '@vue/test-utils'
2
- import AMisRender from '@vue2-client/base-client/components/common/AMisRender/index.vue'
3
- import { it, describe, expect } from '@jest/globals'
4
-
5
- describe('AmisRender', () => {
6
- // 测试用例:正确渲染组件
7
- it('renders correctly', () => {
8
- const wrapper = mount(AMisRender, {
9
- // 组件必要的传参
10
- propsData: {
11
- schema: {
12
- title: '${siteName}:这是 AMIS 表格页面示例',
13
- remark: '嘿,不保证数据准确性',
14
- type: 'page',
15
- body: {
16
- type: 'crud',
17
- draggable: true,
18
- api: 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample',
19
- keepItemSelectionOnPageChange: true,
20
- autoGenerateFilter: true,
21
- bulkActions: [
22
- {
23
- type: 'button',
24
- label: '批量删除',
25
- actionType: 'ajax',
26
- api: 'delete:https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample/${ids|raw}',
27
- confirmText: '确定要批量删除?',
28
- },
29
- {
30
- type: 'button',
31
- label: '批量修改',
32
- actionType: 'dialog',
33
- dialog: {
34
- title: '批量编辑',
35
- name: 'sample-bulk-edit',
36
- body: {
37
- type: 'form',
38
- api: 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample/bulkUpdate2',
39
- body: [
40
- {
41
- type: 'hidden',
42
- name: 'ids',
43
- },
44
- {
45
- type: 'input-text',
46
- name: 'engine',
47
- label: 'Engine',
48
- },
49
- ],
50
- },
51
- },
52
- },
53
- ],
54
- quickSaveApi:
55
- 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample/bulkUpdate',
56
- quickSaveItemApi:
57
- 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample/$id',
58
- headerToolbar: [
59
- 'bulkActions',
60
- {
61
- type: 'button',
62
- label: '重置测试数据',
63
- actionType: 'ajax',
64
- size: 'sm',
65
- api: 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample/reset',
66
- },
67
- 'export-excel',
68
- {
69
- type: 'tpl',
70
- tpl: '一共有 ${count} 行数据。',
71
- className: 'v-middle',
72
- },
73
- {
74
- type: 'columns-toggler',
75
- align: 'right',
76
- draggable: true,
77
- },
78
- {
79
- type: 'drag-toggler',
80
- align: 'right',
81
- },
82
- ],
83
- footerToolbar: ['statistics', 'switch-per-page', 'pagination'],
84
- columns: [
85
- {
86
- name: 'id',
87
- label: 'ID',
88
- width: 20,
89
- sortable: true,
90
- type: 'text',
91
- searchable: {
92
- type: 'input-text',
93
- name: 'id',
94
- label: '主键',
95
- placeholder: '输入id',
96
- },
97
- },
98
- {
99
- name: 'browser',
100
- label: 'Browser',
101
- searchable: {
102
- type: 'select',
103
- name: 'browser',
104
- label: '浏览器',
105
- placeholder: '选择浏览器',
106
- options: [
107
- {
108
- label: 'Internet Explorer ',
109
- value: 'ie',
110
- },
111
- {
112
- label: 'AOL browser',
113
- value: 'aol',
114
- },
115
- {
116
- label: 'Firefox',
117
- value: 'firefox',
118
- },
119
- ],
120
- },
121
- },
122
- {
123
- name: 'platform',
124
- label: '平台',
125
- popOver: {
126
- trigger: 'hover',
127
- body: {
128
- type: 'tpl',
129
- tpl: '就是为了演示有个叫 popOver 的功能',
130
- },
131
- },
132
- sortable: true,
133
- type: 'text',
134
- },
135
- {
136
- name: 'grade',
137
- label: 'CSS 等级',
138
- type: 'select',
139
- options: ['A', 'B', 'C', 'D', 'X'],
140
- },
141
- {
142
- type: 'operation',
143
- label: '操作',
144
- width: 100,
145
- buttons: [
146
- {
147
- type: 'button',
148
- actionType: 'ajax',
149
- label: '删除',
150
- confirmText: '您确认要删除?',
151
- api: 'delete:https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample/$id',
152
- },
153
- ],
154
- },
155
- ],
156
- },
157
- },
158
- locals: {}
159
- }
160
- })
161
- console.debug('返回的组件html:' + wrapper.html())
162
- expect(wrapper.exists()).toBe(true)
163
- })
164
- })