<commit_before>import assert from 'assert';
import { mount } from 'enzyme';
import React from 'react';
import HideAt from './HideAt';

describe('<HideAt />', () => {
  it('allows us to set props', () => {
    const $ = mount((
      <HideAt breakpoint="small" currentBreakpoint="small" />
    ));
    assert.equal($.props().breakpoint, 'small');
    assert.equal($.props().currentBreakpoint, 'small');
    $.setProps({ breakpoint: 'mediumAndBelow' });
    assert.equal($.props().breakpoint, 'mediumAndBelow');
    $.setProps({ currentBreakpoint: 'medium' });
    assert.equal($.props().currentBreakpoint, 'medium');
  });
  it('renders child if props are different', () => {
    const $ = mount((
      <HideAt breakpoint="small" currentBreakpoint="medium">
        <div>Hello</div>
      </HideAt>
    ));
    assert($.contains(<div>Hello</div>), true);
  });
  it('doesn\'t render its children if props are the same', () => {
    const $ = mount((
      <HideAt breakpoint="mediumAndBelow" currentBreakpoint="medium">
        <div>Hello</div>
      </HideAt>
    ));
    assert.deepStrictEqual($.children().exists(), false);
  });
});<commit_msg>test(hide-at): bump up coverage to 💯<commit_after>import assert from 'assert';
import { mount } from 'enzyme';
import React from 'react';
import HideAt from './HideAt';

describe('<HideAt />', () => {
  it('allows us to set props', () => {
    const $ = mount((
      <HideAt breakpoint="small" currentBreakpoint="small" />
    ));
    assert.equal($.props().breakpoint, 'small');
    assert.equal($.props().currentBreakpoint, 'small');
    $.setProps({ breakpoint: 'mediumAndBelow' });
    assert.equal($.props().breakpoint, 'mediumAndBelow');
    $.setProps({ currentBreakpoint: 'medium' });
    assert.equal($.props().currentBreakpoint, 'medium');
  });

  it('renders child if props are different', () => {
    const $ = mount((
      <HideAt breakpoint="small" currentBreakpoint="medium">
        <div>Hello</div>
      </HideAt>
    ));
    assert($.contains(<div>Hello</div>), true);
  });

  it('renders its children if breakpoint is mediumAndBelow and currentBreakpoint is large', () => {
    const $ = mount((
      <HideAt breakpoint="mediumAndBelow" currentBreakpoint="large">
        <div>Hello</div>
      </HideAt>
    ));
    assert($.contains(<div>Hello</div>), true);
  });

  it('renders its children if breakpoint is large and currentBreakpoint is medium', () => {
    const $ = mount((
      <HideAt breakpoint="large" currentBreakpoint="medium">
        <div>Hello</div>
      </HideAt>
    ));
    assert($.contains(<div>Hello</div>), true);
  });

  it('hides its children if breakpoint is large and currentBreakpoint is large', () => {
    const $ = mount((
      <HideAt breakpoint="large" currentBreakpoint="large">
        <div>Hello</div>
      </HideAt>
    ));
    assert.deepStrictEqual($.children().exists(), false);
  });

  it('hides its children if breakpoint is largeAndBelow and currentBreakpoint is large', () => {
    const $ = mount((
      <HideAt breakpoint="largeAndBelow" currentBreakpoint="large">
        <div>Hello</div>
      </HideAt>
    ));
    assert.deepStrictEqual($.children().exists(), false);
  });

  it('hides its children if breakpoint is mediumAndAbove and currentBreakpoint is large', () => {
    const $ = mount((
      <HideAt breakpoint="mediumAndAbove" currentBreakpoint="large">
        <div>Hello</div>
      </HideAt>
    ));
    assert.deepStrictEqual($.children().exists(), false);
  });

  it('hides its children if breakpoint is medium and currentBreakpoint is medium', () => {
    const $ = mount((
      <HideAt breakpoint="medium" currentBreakpoint="medium">
        <div>Hello</div>
      </HideAt>
    ));
    assert.deepStrictEqual($.children().exists(), false);
  });

  it('hides its children if props are the same', () => {
    const $ = mount((
      <HideAt breakpoint="mediumAndBelow" currentBreakpoint="medium">
        <div>Hello</div>
      </HideAt>
    ));
    assert.deepStrictEqual($.children().exists(), false);
  });
});
{'fraction_non_alphanumeric': 0.182377553531873, 'fraction_numerical': 0.0, 'mean_word_length': 3.4512595837897044, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 69, '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': '3046729', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1208, 'n_words': 272}