<commit_before>/* eslint-env jest */

import React from 'react';
import { renderWithTheme } from '../../util/test-utils';

import HorizontalNav from './HorizontalNav';

let instanceToRender;
const onClick = jest.fn();

beforeEach(() => {
  onClick.mockClear();

  instanceToRender = (
    <HorizontalNav selected="home">
      <HorizontalNav.Item id="home" className="home">
        <button type="button" onClick={onClick}>
          Home
        </button>
      </HorizontalNav.Item>
      <HorizontalNav.Item id="cart">
        <button type="button">Cart</button>
      </HorizontalNav.Item>
      <HorizontalNav.Item id="external">
        <a href="https://google.com">External Link</a>
      </HorizontalNav.Item>
      <HorizontalNav.Item id="info" onClick={onClick} isDisabled>
        <button type="button">Disabled</button>
      </HorizontalNav.Item>
    </HorizontalNav>
  );
});

it.only('renders as expected', () => {
  const { container } = renderWithTheme(instanceToRender);
  expect(container).toMatchSnapshot();
});

it.only('executes onClick when nav item clicked', () => {
  const { getByText } = renderWithTheme(instanceToRender);
  getByText('Home').click();
  expect(onClick).toHaveBeenCalled();
});

it.only('disabled item prevents onclick functions', () => {
  const { getByText } = renderWithTheme(instanceToRender);
  getByText('Disabled').click();
  expect(onClick).not.toBeCalled();
});<commit_msg>Update: remove only from several tests<commit_after>/* eslint-env jest */

import React from 'react';
import { renderWithTheme } from '../../util/test-utils';

import HorizontalNav from './HorizontalNav';

let instanceToRender;
const onClick = jest.fn();

beforeEach(() => {
  onClick.mockClear();

  instanceToRender = (
    <HorizontalNav selected="home">
      <HorizontalNav.Item id="home" className="home">
        <button type="button" onClick={onClick}>
          Home
        </button>
      </HorizontalNav.Item>
      <HorizontalNav.Item id="cart">
        <button type="button">Cart</button>
      </HorizontalNav.Item>
      <HorizontalNav.Item id="external">
        <a href="https://google.com">External Link</a>
      </HorizontalNav.Item>
      <HorizontalNav.Item id="info" onClick={onClick} isDisabled>
        <button type="button">Disabled</button>
      </HorizontalNav.Item>
    </HorizontalNav>
  );
});

it('renders as expected', () => {
  const { container } = renderWithTheme(instanceToRender);
  expect(container).toMatchSnapshot();
});

it('executes onClick when nav item clicked', () => {
  const { getByText } = renderWithTheme(instanceToRender);
  getByText('Home').click();
  expect(onClick).toHaveBeenCalled();
});

it('disabled item prevents onclick functions', () => {
  const { getByText } = renderWithTheme(instanceToRender);
  getByText('Disabled').click();
  expect(onClick).not.toBeCalled();
});
{'fraction_non_alphanumeric': 0.16503496503496504, 'fraction_numerical': 0.0, 'mean_word_length': 3.8905982905982905, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 47, 'https://': 2, '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': '1377664', 'n_tokens_mistral': 823, 'n_tokens_neox': 826, 'n_words': 167}