Skip to content

Commit

Permalink
chore(components): fix test warning (#16688)
Browse files Browse the repository at this point in the history
  • Loading branch information
kooriookami committed Apr 28, 2024
1 parent 42aa172 commit 29ae802
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
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

0 comments on commit 29ae802

Please sign in to comment.