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

chore(components): fix test warning #16688

Merged
merged 1 commit into from Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 10 additions & 10 deletions packages/components/checkbox/__tests__/checkbox.test.tsx
Expand Up @@ -365,7 +365,7 @@ describe('check-button', () => {
test('create', async () => {
const checked = ref(false)
const wrapper = mount(() => (
<CheckboxButton v-model={checked.value} label="a" />
<CheckboxButton v-model={checked.value} label="a" value="a" />
))

expect(wrapper.classes()).toContain('el-checkbox-button')
Expand All @@ -378,7 +378,7 @@ describe('check-button', () => {
test('disabled', async () => {
const checked = ref(false)
const wrapper = mount(() => (
<CheckboxButton v-model={checked.value} disabled label="a" />
<CheckboxButton v-model={checked.value} disabled label="a" value="a" />
))

expect(wrapper.classes()).toContain('is-disabled')
Expand Down Expand Up @@ -507,11 +507,11 @@ describe('check-button', () => {
setup() {
return () => (
<CheckboxGroup v-model={checkList.value} max={3}>
<CheckboxButton label="a" ref="a" />
<CheckboxButton label="b" ref="b" />
<CheckboxButton label="c" ref="c" />
<CheckboxButton label="d" ref="d" />
<CheckboxButton label="e" ref="e" />
<CheckboxButton label="a" value="a" ref="a" />
<CheckboxButton label="b" value="b" ref="b" />
<CheckboxButton label="c" value="c" ref="c" />
<CheckboxButton label="d" value="d" ref="d" />
<CheckboxButton label="e" value="e" ref="e" />
</CheckboxGroup>
)
},
Expand Down Expand Up @@ -632,7 +632,7 @@ describe('check-button', () => {
test('single checkbox group in form item, override label', async () => {
const wrapper = mount(() => (
<ElFormItem label="test">
<CheckboxGroup label="Foo">
<CheckboxGroup aria-label="Foo">
<Checkbox label="Foo" value="Foo" />
<Checkbox label="Bar" value="Bar" />
</CheckboxGroup>
Expand All @@ -655,11 +655,11 @@ describe('check-button', () => {
setup() {
return () => (
<ElFormItem label="test">
<CheckboxGroup label="Foo" ref="checkboxGroup1">
<CheckboxGroup aria-label="Foo" ref="checkboxGroup1">
<Checkbox label="Foo" value="Foo" />
<Checkbox label="Bar" value="Bar" />
</CheckboxGroup>
<CheckboxGroup label="Bar" ref="checkboxGroup2">
<CheckboxGroup aria-label="Bar" ref="checkboxGroup2">
<Checkbox label="Foo" value="Foo" />
<Checkbox label="Bar" value="Bar" />
</CheckboxGroup>
Expand Down
16 changes: 8 additions & 8 deletions packages/components/form/__tests__/form.test.tsx
Expand Up @@ -339,10 +339,10 @@ describe('Form', () => {
</FormItem>
<FormItem label="type" prop="type">
<CheckboxGroup v-model={form.type}>
<Checkbox label="type1" name="type" />
<Checkbox label="type2" name="type" />
<Checkbox label="type3" name="type" />
<Checkbox label="type4" name="type" />
<Checkbox label="type1" value="type1" name="type" />
<Checkbox label="type2" value="type2" name="type" />
<Checkbox label="type3" value="type3" name="type" />
<Checkbox label="type4" value="type4" name="type" />
</CheckboxGroup>
</FormItem>
</Form>
Expand Down Expand Up @@ -410,10 +410,10 @@ describe('Form', () => {
</FormItem>
<FormItem label="type" prop="type">
<CheckboxGroup v-model={form.type}>
<Checkbox label="type1" name="type" />
<Checkbox label="type2" name="type" />
<Checkbox label="type3" name="type" />
<Checkbox label="type4" name="type" />
<Checkbox label="type1" value="type1" name="type" />
<Checkbox label="type2" value="type2" name="type" />
<Checkbox label="type3" value="type3" name="type" />
<Checkbox label="type4" value="type4" name="type" />
</CheckboxGroup>
</FormItem>
</Form>
Expand Down
Expand Up @@ -12,7 +12,7 @@ describe('InputNumber.vue', () => {
test('create', async () => {
const num = ref(1)
const wrapper = mount(() => (
<InputNumber label="描述文字" v-model={num.value} />
<InputNumber aria-label="描述文字" v-model={num.value} />
))
expect(wrapper.find('input').exists()).toBe(true)
})
Expand Down
6 changes: 3 additions & 3 deletions packages/components/radio/__tests__/radio.test.tsx
Expand Up @@ -327,7 +327,7 @@ describe('Radio Button', () => {
test('single radio group in form item, override label', async () => {
const wrapper = mount(() => (
<ElFormItem ref="item" label="Test">
<RadioGroup label="Foo" ref="radioGroup">
<RadioGroup aria-label="Foo" ref="radioGroup">
<Radio label="Foo" value="Foo" />
<Radio label="Bar" value="Bar" />
</RadioGroup>
Expand All @@ -346,11 +346,11 @@ describe('Radio Button', () => {
test('multiple radio groups in form item', async () => {
const wrapper = mount(() => (
<ElFormItem ref="item" label="Test">
<RadioGroup label="Foo" ref="radioGroup1">
<RadioGroup aria-label="Foo" ref="radioGroup1">
<Radio label="Foo" value="Foo" />
<Radio label="Bar" value="Bar" />
</RadioGroup>
<RadioGroup label="Bar" ref="radioGroup2">
<RadioGroup aria-label="Bar" ref="radioGroup2">
<Radio label="Foo" value="Foo" />
<Radio label="Bar" value="Bar" />
</RadioGroup>
Expand Down