1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { mount, configure } from 'enzyme';
7 import * as Adapter from "enzyme-adapter-react-16";
8 import { OwnerNameUuidEnhancer, OwnerNameUuidEnhancerProps } from './owner-name-uuid-enhancer';
10 configure({ adapter: new Adapter() });
12 describe('NotFoundPanelRoot', () => {
13 let props: OwnerNameUuidEnhancerProps;
19 uuid: 'zzzz-tpzed-xxxxxxxxxxxxxxx',
23 it('should render uuid without name', () => {
25 const wrapper = mount(<OwnerNameUuidEnhancer {...props} />);
28 expect(wrapper.html()).toBe('<span>zzzz-tpzed-xxxxxxxxxxxxxxx</span>');
31 it('should render uuid with name', () => {
33 const fullName = 'John Doe';
36 props.ownerNamesMap = {
37 [props.uuid]: fullName
41 const wrapper = mount(<OwnerNameUuidEnhancer {...props} />);
44 expect(wrapper.html()).toBe('<span>zzzz-tpzed-xxxxxxxxxxxxxxx (John Doe)</span>');