welcome.spec.jsx 869 B

1234567891011121314151617181920212223242526
  1. import {mountWithTheme} from 'sentry-test/enzyme';
  2. import {initializeOrg} from 'sentry-test/initializeOrg';
  3. import ConfigStore from 'sentry/stores/configStore';
  4. import OnboardingWelcome from 'sentry/views/onboarding/welcome';
  5. describe('OnboardingWelcome', function () {
  6. const {organization} = initializeOrg({});
  7. it('renders', function () {
  8. const name = 'Rick Sanchez';
  9. ConfigStore.loadInitialData({user: {name, options: {}}});
  10. mountWithTheme(<OnboardingWelcome organization={organization} />);
  11. });
  12. it('calls onComplete when progressing', function () {
  13. const onComplete = jest.fn();
  14. const wrapper = mountWithTheme(
  15. <OnboardingWelcome active onComplete={onComplete} organization={organization} />
  16. );
  17. wrapper.find('Button[priority="primary"]').first().simulate('click');
  18. expect(onComplete).toHaveBeenCalled();
  19. });
  20. });