Sha256: 164403b87cbfe2855be6cdcade03b2178178f999017dfab2516b2e52c91792cb
Contents?: true
Size: 1.35 KB
Versions: 87
Compression:
Stored size: 1.35 KB
Contents
import React from 'react'; import { shallow } from 'enzyme'; import toJson from 'enzyme-to-json'; import RedHatRepositoriesPage from '../RedHatRepositoriesPage'; jest.mock('foremanReact/components/PermissionDenied'); describe('RedHatRepositories page', () => { const page = shallow(<RedHatRepositoriesPage loadEnabledRepos={jest.fn()} loadRepositorySets={jest.fn()} updateRecommendedRepositorySets={jest.fn()} enabledRepositories={{ loading: false, search: {}, missingPermissions: [], repositories: [], }} repositorySets={{ recommended: false, loading: false, search: {}, missingPermissions: [], }} />); const permissionDeniedPage = shallow(<RedHatRepositoriesPage loadEnabledRepos={jest.fn()} loadRepositorySets={jest.fn()} updateRecommendedRepositorySets={jest.fn()} enabledRepositories={{ loading: false, search: {}, missingPermissions: ['view_organizations'], }} repositorySets={{ recommended: false, loading: false, search: {}, missingPermissions: ['view_organizations'], }} />); it('should render', async () => { expect(toJson(page)).toMatchSnapshot(); }); it('should render <PermissionDenied /> when permissions are missing', async () => { expect(toJson(permissionDeniedPage)).toMatchSnapshot(); }); });
Version data entries
87 entries across 87 versions & 1 rubygems