OrgPreferences.test.tsx 751 B

12345678910111213141516171819202122232425262728
  1. import React from 'react';
  2. import { shallow } from 'enzyme';
  3. import { OrgPreferences, Props } from './OrgPreferences';
  4. const setup = () => {
  5. const props: Props = {
  6. preferences: {
  7. homeDashboardId: 1,
  8. timezone: 'UTC',
  9. theme: 'Default',
  10. },
  11. starredDashboards: [{ id: 1, title: 'Standard dashboard', url: '', uri: '', uid: '', type: '', tags: [] }],
  12. setOrganizationTimezone: jest.fn(),
  13. setOrganizationTheme: jest.fn(),
  14. setOrganizationHomeDashboard: jest.fn(),
  15. updateOrganizationPreferences: jest.fn(),
  16. };
  17. return shallow(<OrgPreferences {...props} />);
  18. };
  19. describe('Render', () => {
  20. it('should render component', () => {
  21. const wrapper = setup();
  22. expect(wrapper).toMatchSnapshot();
  23. });
  24. });