message: feat: add form label test case
diff: @@ -12,7 +12,7 @@ const Input = React.forwardRef((props: any, ref: any) => {
  );
  });
  -it('passes a11y test in when required', async () => {
  +it('a11y test in when required', async () => {
  let { getByPlaceholderText } = render(
  <Wrapper>
  <FormControl nativeID="name" isRequired>
  @@ -30,7 +30,7 @@ it('passes a11y test in when required', async () => {
  expect(textInput.props.required).toBe(true);
  });
  -it('passes a11y test in when invalid', async () => {
  +it('a11y test in when invalid', async () => {
  let { getByPlaceholderText } = render(
  <Wrapper>
  <FormControl nativeID="name" isInvalid>
  @@ -47,7 +47,7 @@ it('passes a11y test in when invalid', async () => {
  expect(textInput.props.accessibilityInvalid).toBe(true);
  });
  -it('passes a11y test in when readOnly', async () => {
  +it('a11y test in when readOnly', async () => {
  let { getByPlaceholderText } = render(
  <Wrapper>
  <FormControl nativeID="name" isReadOnly>
  @@ -65,7 +65,7 @@ it('passes a11y test in when readOnly', async () => {
  expect(textInput.props.readOnly).toBe(true);
  });
  -it('passes a11y test in when disabled', async () => {
  +it('a11y test in when disabled', async () => {
  let { getByPlaceholderText } = render(
  <Wrapper>
  <FormControl nativeID="name" isDisabled>
  @@ -82,7 +82,7 @@ it('passes a11y test in when disabled', async () => {
  expect(textInput.props.disabled).toBe(true);
  });
  -it('passes a11y test when helper text is present', async () => {
  +it('a11y test when helper text is present', async () => {
  let { getByPlaceholderText } = render(
  <Wrapper>
  <FormControl nativeID="name" isDisabled>
  @@ -98,3 +98,28 @@ it('passes a11y test when helper text is present', async () => {
  expect(textInput.props.accessibilityInvalid).toBeUndefined();
  expect(textInput.props.accessibilityRequired).toBeUndefined();
  });
  +
  +it('sets htmlFor of FormLabel ref to nativeID of Input', async () => {
  + let ref: HTMLLabelElement;
  + const inputID = 'name';
  + let { getByPlaceholderText } = render(
  + <Wrapper>
  + <FormControl nativeID={inputID} isInvalid>
  + <FormControl.Label
  + //@ts-ignore
  + ref={(_ref) => (ref = _ref)}
  + >
  + Name
  + </FormControl.Label>
  + <Input placeholder="Name" />
  + <FormControl.HelperText>Enter your name please!</FormControl.HelperText>
  + <FormControl.ErrorMessage>
  + Your name is invalid
  + </FormControl.ErrorMessage>
  + </FormControl>
  + </Wrapper>
  + );
  + const textInput = getByPlaceholderText('Name');
  + //@ts-ignore
  + expect(textInput.props.nativeID).toBe(ref.htmlFor);
  +});
  