Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/erFormConfig #24

Merged
merged 30 commits into from
Aug 18, 2023
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9c7c1d9
test(erFormConfig): email:pc|Email:mobile
Liberty-liu Aug 17, 2023
abfcea5
test(erFormConfig): cellphone:pc|Cellphone:mobile
Liberty-liu Aug 17, 2023
c9a2270
test(erFormConfig): uRL:pc|URL:mobile
Liberty-liu Aug 17, 2023
f62dd8d
test(erFormConfig): region:pc|Region:mobile
Liberty-liu Aug 17, 2023
c518b3e
test(erFormConfig): iD number:pc|ID number:mobile
Liberty-liu Aug 17, 2023
3cfc79c
test(erFormConfig): input:pc|Input:mobile
Liberty-liu Aug 17, 2023
f6f2f0d
test(erFormConfig): textarea:pc|Textarea:mobile
Liberty-liu Aug 17, 2023
513fa65
test(erFormConfig): number:pc|Number:mobile
Liberty-liu Aug 17, 2023
634290f
test(erFormConfig): radio:pc|Radio:mobile
Liberty-liu Aug 17, 2023
30248fd
test(erFormConfig): checkbox:pc|Checkbox:mobile
Liberty-liu Aug 17, 2023
3f313c0
test(erFormConfig): select:pc|Select:mobile
Liberty-liu Aug 17, 2023
1ce76e9
test(erFormConfig): time:pc|Time:mobile
Liberty-liu Aug 17, 2023
b0fd108
test(erFormConfig): date:pc|Date:mobile
Liberty-liu Aug 17, 2023
2b50099
test(erFormConfig): rate:pc|Rate:mobile
Liberty-liu Aug 17, 2023
0714d54
test(erFormConfig): switch:pc|Switch:mobile
Liberty-liu Aug 17, 2023
5021e4b
test(erFormConfig): slider:pc|Slider:mobile
Liberty-liu Aug 17, 2023
9eb1c04
test(erFormConfig): html:pc|Html:mobile
Liberty-liu Aug 17, 2023
8142a2f
test(erFormConfig): cascader:pc|Cascader:mobile
Liberty-liu Aug 17, 2023
91b1716
test(erFormConfig): file:pc|File:mobile
Liberty-liu Aug 17, 2023
4fbaf6e
test(erFormConfig): signature:pc|Signature:mobile
Liberty-liu Aug 17, 2023
e049b92
test(erFormConfig): grid:pc|Grid:mobile
Liberty-liu Aug 17, 2023
deb418d
test(erFormConfig): grid > col
Liberty-liu Aug 17, 2023
ed76f80
test(erFormConfig): table:pc|Table:mobile
Liberty-liu Aug 17, 2023
0f87550
test(erFormConfig): table > td
Liberty-liu Aug 17, 2023
521b26e
test(erFormConfig): tabs:pc|Tabs:mobile
Liberty-liu Aug 18, 2023
d9e5aae
test(erFormConfig): tabs > tabsCol
Liberty-liu Aug 18, 2023
78727bf
test(erFormConfig): collapse:pc|Collapse:mobile
Liberty-liu Aug 18, 2023
ac2fd68
test(erFormConfig): collapse > collapseCol
Liberty-liu Aug 18, 2023
a49196f
test(erFormConfig): divider:pc|Divider:mobile
Liberty-liu Aug 18, 2023
14bd5f0
test(erFormConfig): root:pc|Root:mobile
Liberty-liu Aug 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(erFormConfig): number:pc|Number:mobile
  • Loading branch information
Liberty-liu committed Aug 17, 2023
commit 513fa654bfecb5a8aaa2137d6ae7a5a4f3320a9d
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ import PanelsConfigComponentsDataComponent1 from './DataComponent1.jsx'
import PanelsConfigComponentsDataComponent2 from './DataComponent2.jsx'
import PanelsConfigComponentsDataComponent3 from './DataComponent3.vue'
import Icon from '@ER/icon'
import _ from 'lodash-es'
export default {
name: 'ConfigPropsPanel',
inheritAttrs: false,
@@ -486,7 +487,7 @@ onMounted(() => {
<template v-else-if="checkTypeBySelected(['number'], 'defaultValue')">
<el-input-number
style="width: 100%;"
v-bind="typeProps"
v-bind="_.merge(typeProps, utils.addTestId('configPanel:defaultValue'))"
v-model="target.options.defaultValue"
/>
</template>
@@ -938,7 +939,12 @@ onMounted(() => {
v-bind="utils.addTestId('configPanel:filterable')"
>
</PanelsConfigComponentsCheckboxComponent>
<PanelsConfigComponentsCheckboxComponent v-if="isPc && checkTypeBySelected(['number'], 'controls')" :label="t('er.config.propsPanel.numberControls.label')" field="controls">
<PanelsConfigComponentsCheckboxComponent
v-if="isPc && checkTypeBySelected(['number'], 'controls')"
:label="t('er.config.propsPanel.numberControls.label')"
field="controls"
v-bind="utils.addTestId('configPanel:controls')"
>
<PanelsConfigComponentsTypeComponent
@listener="handleTypeListener"
property="controlsPosition"
55 changes: 55 additions & 0 deletions test/erFormConfig.test.js
Original file line number Diff line number Diff line change
@@ -114,6 +114,7 @@ describe('Configuration options owned by the config panel', () => {
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
test('Email:mobile', async () => {
wrapper.findComponent({ ref: 'EReditorRef' }).vm.switchPlatform('mobile')
@@ -134,6 +135,7 @@ describe('Configuration options owned by the config panel', () => {
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
test('Cellphone:pc', async () => {
value0.value = store.fields[1].id
@@ -153,6 +155,7 @@ describe('Configuration options owned by the config panel', () => {
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
test('Cellphone:mobile', async () => {
wrapper.findComponent({ ref: 'EReditorRef' }).vm.switchPlatform('mobile')
@@ -173,6 +176,7 @@ describe('Configuration options owned by the config panel', () => {
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
test('URL:pc', async () => {
value0.value = store.fields[2].id
@@ -192,6 +196,7 @@ describe('Configuration options owned by the config panel', () => {
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
test('URL:mobile', async () => {
wrapper.findComponent({ ref: 'EReditorRef' }).vm.switchPlatform('mobile')
@@ -212,6 +217,7 @@ describe('Configuration options owned by the config panel', () => {
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
test('Region:pc', async () => {
value0.value = store.fields[3].id
@@ -232,6 +238,7 @@ describe('Configuration options owned by the config panel', () => {
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
test('Region:mobile', async () => {
wrapper.findComponent({ ref: 'EReditorRef' }).vm.switchPlatform('mobile')
@@ -253,6 +260,7 @@ describe('Configuration options owned by the config panel', () => {
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
test('ID number:pc', async () => {
value0.value = store.fields[4].id
@@ -272,6 +280,7 @@ describe('Configuration options owned by the config panel', () => {
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
test('ID number:mobile', async () => {
wrapper.findComponent({ ref: 'EReditorRef' }).vm.switchPlatform('mobile')
@@ -292,6 +301,7 @@ describe('Configuration options owned by the config panel', () => {
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
test('Input:pc', async () => {
value0.value = store.fields[5].id
@@ -311,6 +321,7 @@ describe('Configuration options owned by the config panel', () => {
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
test('Input:mobile', async () => {
wrapper.findComponent({ ref: 'EReditorRef' }).vm.switchPlatform('mobile')
@@ -331,6 +342,7 @@ describe('Configuration options owned by the config panel', () => {
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
test('Textarea:pc', async () => {
value0.value = store.fields[6].id
@@ -350,6 +362,7 @@ describe('Configuration options owned by the config panel', () => {
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
test('Textarea:mobile', async () => {
wrapper.findComponent({ ref: 'EReditorRef' }).vm.switchPlatform('mobile')
@@ -370,5 +383,47 @@ describe('Configuration options owned by the config panel', () => {
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
test('Number:pc', async () => {
value0.value = store.fields[7].id
await nextTick()
expect(wrapper.find(utils.getTestId('configPanel:breadcrumb')).findAll('.el-breadcrumb__item').map(e => e.text())).toEqual(['Form Attribute', 'Number'])
expect(wrapper.find(utils.getTestId('configPanel:id')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:title')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:titleWidth')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:defaultValue')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:placeholder')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:isShowTrim')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:required')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:disabled')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:clearable')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:width')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:prepend')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(true)
})
test('Number:mobile', async () => {
wrapper.findComponent({ ref: 'EReditorRef' }).vm.switchPlatform('mobile')
value0.value = store.fields[7].id
await nextTick()
expect(wrapper.find(utils.getTestId('configPanel:breadcrumb')).findAll('.el-breadcrumb__item').map(e => e.text())).toEqual(['Form Attribute', 'Number'])
expect(wrapper.find(utils.getTestId('configPanel:id')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:title')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:titleWidth')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:defaultValue')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:placeholder')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:isShowTrim')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:required')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:disabled')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:clearable')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:width')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:prepend')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:append')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:textareaHeight')).exists()).toBe(false)
expect(wrapper.find(utils.getTestId('configPanel:wordLimit')).exists()).toBe(true)
expect(wrapper.find(utils.getTestId('configPanel:controls')).exists()).toBe(false)
})
})