test('that the landing page route is configured', async () => { const types = listOf(simpleObject); resourcesController.listResourceTypes.resolves(types); const {primaryNav} = await handler(); assert.deepEqual(primaryNav, types); });
test('that list is rendered when not empty', () => { const resources = listOf(() => ({...simpleObject(), id: integer(), displayName: string()})); const wrapper = shallow(<MaybeList resources={resources} resourceType={resourceType} loading={false} />); const list = wrapper.find('ConditionalList'); assert.equal(wrapper.find('HelmetWrapper').prop('title'), resourceType); assert.equal(list.dive().find('ResourceList').prop('resources'), resources); });
Given(/^user has api privileges$/, function (callback) { this.availableResourceTypes = _.uniq(listOf(word, { min: 1 })); this.stubApiCatalogCall(); callback(); });
test('that redux state is mapped to props', () => { const list = listOf(() => ({...simpleObject(), id: integer(), displayName: string()})); const type = string(); const loading = boolean(); const wrapper = shallow(<ConnectedList store={createStore(() => fromJS({resources: {list, type, loading}}))} />); assert.deepEqual(wrapper.prop('resources'), list); assert.equal(wrapper.prop('resourceType'), type); assert.equal(wrapper.prop('loading'), loading); });