{"size": 1074, "ext": "js", "max_stars_repo_path": "src/screens/DonateScreen/accessibilityLabel.ios.test.js", "max_stars_repo_name": "github-clonner/pride-london-app", "max_stars_repo_stars_event_min_datetime": "2018-02-18T10:58:27.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-19T08:11:21.000Z", "max_issues_repo_path": "src/screens/DonateScreen/accessibilityLabel.ios.test.js", "max_issues_repo_name": "github-clonner/pride-london-app", "max_issues_repo_issues_event_min_datetime": "2018-02-08T11:44:58.000Z", "max_issues_repo_issues_event_max_datetime": "2019-02-20T08:31:21.000Z", "max_forks_repo_path": "src/screens/DonateScreen/accessibilityLabel.ios.test.js", "max_forks_repo_name": "github-clonner/pride-london-app", "max_forks_repo_forks_event_min_datetime": "2018-02-12T17:25:40.000Z", "max_forks_repo_forks_event_max_datetime": "2020-12-13T10:21:34.000Z"}
{"max_stars_count": 90, "max_issues_count": 445, "max_forks_count": 26, "avg_line_length": 29.027027027, "max_line_length": 77, "alphanum_fraction": 0.6145251397}
// @flow
import getAccessibilityLabel from "./accessibilityLabel.ios";

const cases = [
  {
    name: "not focused, placeholder, value",
    values: ["Company", "Your company", "Aperture Science", false, undefined]
  },
  {
    name: "not focused, placeholder, no value",
    values: ["Company", "Your company", "", false, undefined]
  },
  {
    name: "not focused, no placeholder, no value",
    values: ["Company", undefined, "", false, undefined]
  },
  {
    name: "focused, placeholder, value, no selection",
    values: ["Company", "Your company", "Aperture Science", true, undefined]
  },
  {
    name: "focused, placeholder, no value, selection at start",
    values: ["Company", "Your company", "", true, { start: 0, end: 0 }]
  },
  {
    name: "focused, no placeholder, no value, selection at end",
    values: ["Company", undefined, "", true, { start: 7, end: 7 }]
  }
];

cases.forEach(c => {
  it(`returns value VoiceOver would say if: ${c.name}`, () => {
    const output = getAccessibilityLabel(...c.values);
    expect(output).toMatchSnapshot();
  });
});
