buttonBar.spec.jsx 865 B

1234567891011121314151617181920212223242526
  1. import {mountWithTheme} from 'sentry-test/enzyme';
  2. import Button from 'app/components/button';
  3. import ButtonBar from 'app/components/buttonBar';
  4. describe('ButtonBar', function () {
  5. const createWrapper = () =>
  6. mountWithTheme(
  7. <ButtonBar active="2" merged>
  8. <Button barId="1">First Button</Button>
  9. <Button barId="2">Second Button</Button>
  10. <Button barId="3">Third Button</Button>
  11. <Button barId="4">Fourth Button</Button>
  12. </ButtonBar>
  13. );
  14. it('has "Second Button" as the active button in the bar', function () {
  15. const wrapper = createWrapper();
  16. expect(wrapper.find('Button').at(1).prop('priority')).toBe('primary');
  17. });
  18. it('does not pass `barId` down to the button', function () {
  19. const wrapper = createWrapper();
  20. expect(wrapper.find('Button').at(1).prop('barId')).toBeUndefined();
  21. });
  22. });