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-8317: Lease and Licence Edit/View Fee Denomination forms #4187

Merged
merged 16 commits into from
Jul 12, 2024

Conversation

stairaku
Copy link
Collaborator

No description provided.

@stairaku stairaku added enhancement New feature or request 5.4 labels Jul 11, 2024
@stairaku stairaku self-assigned this Jul 11, 2024
Copy link
Contributor

✅ No secrets were detected in the code.

Copy link
Contributor

✅ No secrets were detected in the code.

@@ -114,6 +114,11 @@ export const AddLeaseYupSchema = Yup.object().shape({
primaryArbitrationCity: Yup.string()
.nullable()
.max(200, 'Primary arbitration city must be at most ${max} characters'),
isPublicBenefit: Yup.string().nullable(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, these are defined as booleans in the frontend model.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken out the nullable validation on the yup schema since is not needed.


export default FeeDeterminationSubForm;

const MediumTextArea = styled(TextArea)`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary? I'm surprised that you needed to manually specify the height here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this since height is not needed

},
},
],
amount: 1,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when writing tests, please try and keep the test data as minimal as "focused" as possible on the parameters necessary to evaluate the component under test. For example, for this test, a large number of these fields will not have an effect on what is rendered, and can be removed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduced the amount of variable required for unit testing.

expect(getByDisplayValue('Yes')).toBeVisible();
});

it('renders the suggested Fee field', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since there is a calculation, I'd actually rather see more tests for this then the other fields. In general we don't need to write one test for field as that doesn't scale, but we want to write tests for non-trivial logic or business rules.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deleted the fields tests and increase the number of unit tests regarding the calculation of the suggested fee.

@@ -31,7 +31,9 @@ describe('Compensation Detail View Component', () => {
<CompensationRequisitionDetailView
acquisitionFile={renderOptions?.props?.acquisitionFile ?? mockAcquisitionFileResponse()}
compensation={renderOptions?.props?.compensation ?? getMockApiDefaultCompensation()}
compensationProperties={renderOptions?.props?.compensationProperties ?? getMockCompensationPropertiesReq()}
compensationProperties={
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is just a lint thing. I no longer see this file on my PR update.

@devinleighsmith
Copy link
Collaborator

@stairaku please ask Julian what he means by this:

(from confluence)
image
I don't see this in the implementation, but I'm also not sure where the above should be.

Copy link
Contributor

✅ No secrets were detected in the code.

Copy link
Contributor

✅ No secrets were detected in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.4 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants