Skip to content

Missing cases #4

@billybonks

Description

@billybonks

Hi, thanks for the work on this code. I want to use the getName API for something else that I am building, so i was testing some of the cases and realised that 5.2 was not working.

https://www.w3.org/TR/html-aam-1.0/#input-type-button-input-type-submit-and-input-type-reset-accessible-name-computation

my tests were

  describe('5.2 button input should behave like buttons', () => {
    test('it uses value', () => {
      document.body.innerHTML = `
        <input id="el" type="button" value="the world! dog!"/>
      `;
      const foundInput = findControl('the world! dog!');
      expect(foundInput).toEqual(document.getElementById('el'));
    });

    test('deafults submit if no content', () => {
      document.body.innerHTML = `
        <input id="el" type="submit"></input>
      `;
      const foundInput = findControl('submit');
      expect(foundInput).toEqual(document.getElementById('el'));
    });

    test('deafults reset if no content', () => {
      document.body.innerHTML = `
        <input id="el" type="reset"></input>
      `;
      const foundInput = findControl('reset');
      expect(foundInput).toEqual(document.getElementById('el'));
    });
  });

would love to get your thoughts if this should be handled by the tool or if it shouldn't be?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions