Repository: element-plus/element-plus
File: packages/components/time-select/__tests__/time-select.test.tsx (TypeScript)

Code before:
      )
    })

    it('specified id attachment', async () => {
      const wrapper = mount(() => (
        <ElFormItem label="Foobar" data-test-ref="item">
          <TimeSelect
            // type checking failed as `id` is a fallthrough attribute
            // @ts-ignore
            id="foobar"
          />
        </ElFormItem>
      ))

      await nextTick()
      const formItem = wrapper.find('[data-test-ref="item"]')
      const formItemLabel = formItem.find('.el-form-item__label')
      const timeSelectInput = wrapper.find('input')
      expect(formItem.attributes().role).toBeFalsy()
      expect(timeSelectInput.attributes().id).toBe('foobar')
      expect(formItemLabel.attributes().for).toBe(
        timeSelectInput.attributes().id
      )
    })

    it('The disabled state of a component has higher priority than that of a form', async () => {
      const wrapper = mount(() => (
        <ElFormItem label="Foobar" data-test-ref="item">
          <TimeSelect />
          <TimeSelect />
        </ElFormItem>
      ))

      await nextTick()
      const formItem = wrapper.find('[data-test-ref="item"]')
      expect(formItem.attributes().role).toBe('group')
    })

    it('form disabled, but timeSelect is not', async () => {
      const wrapper = mount(() => (
        <ElForm disabled>
          <TimeSelect disabled={false} />
        </ElForm>
      ))

      await nextTick()
      const input = wrapper.find('input')
      expect(input.attributes('disabled')).toBeUndefined()
    })
  })
})

Review comment (bug):
```suggestion
    it('form item role is group when multiple inputs', async () => {
```

It seems this was changed in the wrong place.

Code after:
      )
    })

    it('specified id attachment', async () => {
      const wrapper = mount(() => (
        <ElFormItem label="Foobar" data-test-ref="item">
          <TimeSelect
            // type checking failed as `id` is a fallthrough attribute
            // @ts-ignore
            id="foobar"
          />
        </ElFormItem>
      ))

      await nextTick()
      const formItem = wrapper.find('[data-test-ref="item"]')
      const formItemLabel = formItem.find('.el-form-item__label')
      const timeSelectInput = wrapper.find('input')
      expect(formItem.attributes().role).toBeFalsy()
      expect(timeSelectInput.attributes().id).toBe('foobar')
      expect(formItemLabel.attributes().for).toBe(
        timeSelectInput.attributes().id
      )
    })

    it('form item role is group when multiple inputs', async () => {
      const wrapper = mount(() => (
        <ElFormItem label="Foobar" data-test-ref="item">
          <TimeSelect />
          <TimeSelect />
        </ElFormItem>
      ))

      await nextTick()
      const formItem = wrapper.find('[data-test-ref="item"]')
      expect(formItem.attributes().role).toBe('group')
    })

    it('The disabled state of a component has higher priority than that of a form', async () => {
      const wrapper = mount(() => (
        <ElForm disabled>
          <TimeSelect disabled={false} />
        </ElForm>
      ))

      await nextTick()
      const input = wrapper.find('input')
      expect(input.attributes('disabled')).toBeUndefined()
    })
  })
})