welcome.spec.jsx 853 B

1234567891011121314151617181920212223242526
  1. import {initializeOrg} from 'sentry-test/initializeOrg';
  2. import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
  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. render(<OnboardingWelcome organization={organization} />);
  11. });
  12. it('calls onComplete when progressing', function () {
  13. const onComplete = jest.fn();
  14. render(
  15. <OnboardingWelcome active onComplete={onComplete} organization={organization} />
  16. );
  17. userEvent.click(screen.getByRole('button', {name: 'Start'}));
  18. expect(onComplete).toHaveBeenCalled();
  19. });
  20. });