buttonBar.spec.jsx 893 B

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