// @flow
import {
  getHideDisplaySm,
  getHideDisplayMd,
  getHideDisplayLg,
  getHideDisplayXl,
  getHideDisplay,
} from './hide.css-rules';

describe('hide', () => {
  describe('getHideDisplay', () => {
    describe('string value', () => {
      it('hides if string hide matches size', () => {
        const display = getHideDisplay('sm', 'sm');
        expect(display).toBe('none');
      });

      it('does not hide if string hide does not match size', () => {
        const display = getHideDisplay('md', 'sm');
        expect(display).toBe();
      });
    });
  });

  describe('getHideDisplaySm', () => {
    it('returns none if small is hidden', () => {
      const display = getHideDisplaySm({ hide: ['sm'] });
      expect(display).toBe('none');
    });

    it('returns undefined if small is not hidden', () => {
      const display = getHideDisplaySm({ hide: ['xl'] });
      expect(display).toBe();
    });
  });

  describe('getHideDisplayMd', () => {
    it('returns none if medium is hidden', () => {
      const display = getHideDisplayMd({ hide: ['md'] });
      expect(display).toBe('none');
    });

    it('returns undefined if medium is not hidden', () => {
      const display = getHideDisplayMd({ hide: ['xl'] });
      expect(display).toBe();
    });
  });

  describe('getHideDisplayLg', () => {
    it('returns none if large is hidden', () => {
      const display = getHideDisplayLg({ hide: ['lg'] });
      expect(display).toBe('none');
    });

    it('returns undefined if large is not hidden', () => {
      const display = getHideDisplayLg({ hide: ['xl'] });
      expect(display).toBe();
    });
  });

  describe('getHideDisplayXl', () => {
    it('returns none if x-large is hidden', () => {
      const display = getHideDisplayXl({ hide: ['xl'] });
      expect(display).toBe('none');
    });

    it('returns undefined if x-large is not hidden', () => {
      const display = getHideDisplayXl({ hide: ['sm'] });
      expect(display).toBe();
    });
  });
});
