<commit_before>import React from "react";
import renderer from "react-test-renderer";
import ProjectAccountSwitcherPresenter from "./ProjectAccountSwitcherPresenter";

describe("project-account-switcher/presenters/ProjectAccountSwitcherPresenter", () => {
  [
    {
      description: "renders without props",
      props: {}
    },
    {
      description: "renders with all props",
      props: {
        accountTitle: "Accounts",
        accounts: [
          { id: "1", label: "Account 1" },
          { id: "2", label: "Account 2" }
        ],
        activeAccountId: "1",
        activeProjectId: "2",
        onAccountClick: function onAccountClick() {},
        onProjectClick: function onProjectClick() {},
        projectTitle: "Projects",
        projects: [
          { id: "1", label: "Project 1" },
          { id: "2", label: "Project 2" }
        ]
      }
    }
  ].forEach(({ description, props: { children, ...otherProps } }) => {
    it(description, () => {
      const presenter = (
        <ProjectAccountSwitcherPresenter {...otherProps}>
          {children}
        </ProjectAccountSwitcherPresenter>
      );
      const tree = renderer.create(presenter).toJSON();

      expect(tree).toMatchSnapshot();
    });
  });
});<commit_msg>test: use snapshot helper<commit_after>import React from "react";
import { takeSnapshotsOf } from "@hig/jest-preset/helpers";
import ProjectAccountSwitcherPresenter from "./ProjectAccountSwitcherPresenter";

describe("project-account-switcher/presenters/ProjectAccountSwitcherPresenter", () => {
  [
    {
      description: "renders without props",
      props: {}
    },
    {
      description: "renders with all props",
      props: {
        accountTitle: "Accounts",
        accounts: [
          { id: "1", label: "Account 1" },
          { id: "2", label: "Account 2" }
        ],
        activeAccountId: "1",
        activeProjectId: "2",
        onAccountClick: function onAccountClick() {},
        onProjectClick: function onProjectClick() {},
        projectTitle: "Projects",
        projects: [
          { id: "1", label: "Project 1" },
          { id: "2", label: "Project 2" }
        ]
      }
    }
  ].forEach(({ description, props }) => {
    takeSnapshotsOf(ProjectAccountSwitcherPresenter, [
      { desc: description, props: props }
    ]);
  });
});
{'fraction_non_alphanumeric': 0.14597602739726026, 'fraction_numerical': 0.008561643835616438, 'mean_word_length': 2.488059701492537, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3320697', 'n_tokens_mistral': 679, 'n_tokens_neox': 680, 'n_words': 147}