<commit_before>import React from 'react';

import { configure, mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { PortalProvider, WhitePortal, BlackPortal } from '.';

configure({ adapter: new Adapter() });

test('is working', () => {
  const wrapper = mount(<div>hey</div>);
  expect(wrapper.contains('hey')).toBeTruthy();
});<commit_msg>add test cases<commit_after>import React from 'react';

import { configure, mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { PortalProvider, WhitePortal, BlackPortal } from '.';

configure({ adapter: new Adapter() });
const YourApp = () => <div>ok</div>;
test('smoke test', () => {
  const wrapper = mount(
    <PortalProvider>
      <YourApp />
    </PortalProvider>
  );
  expect(wrapper.contains('ok')).toBeTruthy();
  wrapper.unmount();
});

test('basic', () => {
  const wrapper = mount(
    <PortalProvider>
      <div>
        a
        <WhitePortal name="one" />
        b
        <BlackPortal name="one">1</BlackPortal>
        c
      </div>
    </PortalProvider>
  );
  expect(wrapper.text()).toBe('a1bc');
  wrapper.unmount();
});

test('name mismatch', () => {
  const wrapper = mount(
    <PortalProvider>
      <div>
        a
        <WhitePortal name="two" />
        b
        <BlackPortal name="one">1</BlackPortal>
        c
      </div>
    </PortalProvider>
  );
  expect(wrapper.text()).toBe('abc');
  wrapper.unmount();
});

test('multiple WhitePortal', () => {
  const wrapper = mount(
    <PortalProvider>
      <div>
        a
        <WhitePortal name="one" />
        <WhitePortal name="one" />
        b
        <BlackPortal name="one">1</BlackPortal>
        c
      </div>
    </PortalProvider>
  );
  expect(wrapper.text()).toBe('a11bc');
  wrapper.unmount();
});
{'fraction_non_alphanumeric': 0.17902955939765755, 'fraction_numerical': 0.005577244841048522, 'mean_word_length': 2.9602649006622515, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 38, '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': '7079364', 'n_tokens_mistral': 588, 'n_tokens_neox': 580, 'n_words': 120}