123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import React from 'react';
- import {render} from 'enzyme';
- import {Client} from 'app/api';
- import OrganizationDetails from 'app/views/organizationDetails';
- describe('OrganizationDetails', function() {
- beforeEach(function() {
- Client.clearMockResponses();
- });
- describe('render()', function() {
- describe('pending deletion', () => {
- it('should render a restoration prompt', function() {
- Client.addMockResponse({
- url: '/organizations/org-slug/',
- body: TestStubs.Organization({
- slug: 'org-slug',
- status: {
- id: 'pending_deletion',
- name: 'pending deletion',
- },
- }),
- });
- let tree = render(<OrganizationDetails params={{orgId: 'org-slug'}} />);
- expect(tree).toMatchSnapshot();
- });
- it('should render a restoration prompt without action for members', function() {
- Client.addMockResponse({
- url: '/organizations/org-slug/',
- body: TestStubs.Organization({
- slug: 'org-slug',
- access: [],
- status: {
- id: 'pending_deletion',
- name: 'pending deletion',
- },
- }),
- });
- let tree = render(<OrganizationDetails params={{orgId: 'org-slug'}} />);
- expect(tree).toMatchSnapshot();
- });
- });
- describe('deletion in progress', () => {
- beforeEach(() => {
- Client.addMockResponse({
- url: '/organizations/org-slug/',
- body: TestStubs.Organization({
- slug: 'org-slug',
- status: {
- id: 'deletion_in_progress',
- name: 'deletion in progress',
- },
- }),
- });
- });
- it('should render a deletion in progress prompt', function() {
- let tree = render(<OrganizationDetails params={{orgId: 'org-slug'}} />);
- expect(tree).toMatchSnapshot();
- });
- });
- });
- });
|