Skip to content

Commit

Permalink
psp-5791: add assignee to tenant types
Browse files Browse the repository at this point in the history
  • Loading branch information
buddy326 committed Jun 26, 2023
1 parent bc4b795 commit 7704a11
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ describe('Tenant component', () => {
expect(notes).toHaveLength(2);
});

it('renders assignee section', () => {
const { component } = setup({
lease: { ...defaultLease, persons: [] },
});
const { getAllByText } = component;
const asgnSection = getAllByText('Assignee');

expect(asgnSection).toHaveLength(1);
});

it('renders representative section', () => {
const { component } = setup({
lease: { ...defaultLease, persons: [] },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,28 @@ export const ViewTenantForm: React.FunctionComponent<React.PropsWithChildren<ITe
name={withNameSpace(nameSpace, 'properties')}
render={renderProps => (
<>
<Section header="Assignee">
{tenants.map(
(tenant: FormTenant, index) =>
tenant.tenantType === 'ASGN' && (
<div key={`tenants-${index}`}>
<>
{tenant.organizationId ? (
<TenantOrganizationContactInfo
disabled={true}
nameSpace={withNameSpace(nameSpace, `tenants.${index}`)}
/>
) : (
<TenantPersonContactInfo
disabled={true}
nameSpace={withNameSpace(nameSpace, `tenants.${index}`)}
/>
)}
</>
</div>
),
)}
</Section>
<Section header="Tenant">
{tenants.map(
(tenant: FormTenant, index) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,26 @@ exports[`Tenant component renders as expected 1`] = `
<div
class="c0 c1"
>
<div
class="c2 form-section"
>
<h2
class="c3"
>
<div
class="no-gutters row"
>
<div
class="col"
>
Assignee
</div>
</div>
</h2>
<div
class="collapse show"
/>
</div>
<div
class="c2 form-section"
>
Expand Down

0 comments on commit 7704a11

Please sign in to comment.