Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psp-5791: add assignee to tenant types #3290

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ describe('Tenant component', () => {
expect(notes).toHaveLength(2);
});

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

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

it('renders representative section', () => {
const { component } = setup({
lease: { ...defaultApiLease, tenants: [] },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,36 @@
>
<>
<LoadingBackdrop show={loading} parentScreen />
<Section header="Assignee">
{tenants.map(
(tenant: FormTenant, index) =>
tenant.tenantType === 'ASGN' && (
<div key={`tenants-${index}`}>

Check warning on line 42 in source/frontend/src/features/leases/detail/LeasePages/tenant/ViewTenantForm.tsx

View check run for this annotation

Codecov / codecov/patch

source/frontend/src/features/leases/detail/LeasePages/tenant/ViewTenantForm.tsx#L42

Added line #L42 was not covered by tests
<>
{tenant.organizationId ? (
<TenantOrganizationContactInfo

Check warning on line 45 in source/frontend/src/features/leases/detail/LeasePages/tenant/ViewTenantForm.tsx

View check run for this annotation

Codecov / codecov/patch

source/frontend/src/features/leases/detail/LeasePages/tenant/ViewTenantForm.tsx#L45

Added line #L45 was not covered by tests
disabled={true}
nameSpace={withNameSpace(nameSpace, `tenants.${index}`)}
/>
) : (
<TenantPersonContactInfo

Check warning on line 50 in source/frontend/src/features/leases/detail/LeasePages/tenant/ViewTenantForm.tsx

View check run for this annotation

Codecov / codecov/patch

source/frontend/src/features/leases/detail/LeasePages/tenant/ViewTenantForm.tsx#L50

Added line #L50 was not covered by tests
disabled={true}
nameSpace={withNameSpace(nameSpace, `tenants.${index}`)}
/>
)}
</>
</div>
),
)}
</Section>

<Section header="Tenant">
{tenants.map(
(tenant: FormTenant, index) =>
tenant.tenantType === 'TEN' && (
<div key={`tenants-${index}`}>
<>
{tenant.lessorTypeCode?.id === 'ORG' ? (
{tenant.organizationId ? (
<TenantOrganizationContactInfo
disabled={true}
nameSpace={withNameSpace(nameSpace, `tenants.${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