notificationSettingsByOrganization.spec.tsx 956 B

123456789101112131415161718192021222324252627282930
  1. import {initializeOrg} from 'sentry-test/initializeOrg';
  2. import {render, screen} from 'sentry-test/reactTestingLibrary';
  3. import NotificationSettingsByOrganization from 'sentry/views/settings/account/notifications/notificationSettingsByOrganization';
  4. describe('NotificationSettingsByOrganization', function () {
  5. it('should render', function () {
  6. const settings = {
  7. alerts: {
  8. user: {me: {email: 'always', slack: 'always'}},
  9. organization: {1: {email: 'always', slack: 'always'}},
  10. },
  11. };
  12. const {organization, routerContext} = initializeOrg();
  13. render(
  14. <NotificationSettingsByOrganization
  15. notificationType="alerts"
  16. notificationSettings={settings}
  17. organizations={[organization]}
  18. onChange={jest.fn()}
  19. onSubmitSuccess={jest.fn()}
  20. />,
  21. {context: routerContext}
  22. );
  23. expect(screen.getByRole('textbox', {name: 'org-slug'})).toBeInTheDocument();
  24. });
  25. });