Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing title and fix end date in view licence
https://eaflood.atlassian.net/browse/WATER-4322 Whilst working on [Add registered user modifier to LicenceModel](#693) we spotted the that the new view licence page is missing its title. So this PR change was originally intended to fix just that. As part of it we spotted that there was no direct unit test for the `ViewLicencePresenter` so we included adding that as well. But when doing so we spotted an inconsistency with the end date and the warning. If the licence's `expiredDate` is null or less than today's date then we return `null`. We only want to show the **End date** field when a licence is not yet 'ended' but has an expiry date. But if the licence has an expired date equal to today then we will return a formatted date string and show the field in the view. The problem is the logic in `_generateWarningMessage()` determines a warning message is needed if a licence's end date is equal to today or less. Basically, if a licence's `expiredDate` matches the current date (today) we'll show both the **End date** field and the warning message. So, this change also clears that issue up!
- Loading branch information