// @flow
import React from 'react';
import { mountWrappedComponent } from '../../../../../utils/tests';

import type { ContextMenuListContainerProps } from './index';
import { ContextMenuListContainer } from './index';

const DEFAULT_PROPS: ContextMenuListContainerProps = {
  justify: 'left',
  role: 'menu',
};

describe('ContextMenuListContainer', () => {
  describe('justify', () => {
    it('left aligns itself if given a justify value of left', () => {
      const container = mountWrappedComponent(
        <ContextMenuListContainer {...DEFAULT_PROPS} justify="left" />,
      );

      expect(container).toHaveStyleRule('left', '0');
      expect(container).not.toHaveStyleRule('right', '0');
    });

    it('right aligns itself if given a justify value of right', () => {
      const container = mountWrappedComponent(
        <ContextMenuListContainer {...DEFAULT_PROPS} justify="right" />,
      );

      expect(container).toHaveStyleRule('right', '0');
      expect(container).not.toHaveStyleRule('left', '0');
    });
  });
});
