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

Improve coverage #4228

Merged
merged 12 commits into from
Sep 26, 2024
Merged

Improve coverage #4228

merged 12 commits into from
Sep 26, 2024

Conversation

KludgeKML
Copy link
Contributor

@KludgeKML KludgeKML commented Sep 11, 2024

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

What

Various updates to improve coverage, plus bug fixes discovered while improving coverage:

  • fix sessions controller always ignoring referer when deciding if a redirect was valid

Current improvement in line coverage: 97.99% -> 98.47%
Current improvement in branch coverage: 86.36% -> 89.39%

Why

As we move the routes from government-frontend over, the better our existing coverage the easier it will be to spot coverage problems in the new code. Ideally if we have 100% line coverage, any lack of coverage in the new code will stick out like a sore thumb. We should also strive for 100% branch coverage as a secondary goal.

https://trello.com/c/cCAkk9wZ/300-consolidate-4-frontend-apps

How

Screenshots?

@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4228 September 11, 2024 14:29 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4228 September 11, 2024 15:19 Inactive
Copy link
Contributor

@leenagupte leenagupte left a comment

Choose a reason for hiding this comment

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

This is great! ⭐

There's only one nitpick in the comments.

context "rendering the sign-in help page" do
before do
payload = {
base_path: "/help/sign-in",
Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocking nitpick. This should be /sign-in to match the base_path used in the rest of these tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah, d'oh. Thanks!

@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4228 September 11, 2024 20:47 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4228 September 12, 2024 08:59 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4228 September 18, 2024 11:57 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4228 September 18, 2024 12:05 Inactive
- the links in the travel advice index are all countries, and countries have to have a name (it's required in the schema), so no need to test here.
- this method is never called.
- Fix this bug, and update the tests that were all passing only because this bug existed.
- Remove the dev-mode only passthrough, as its not clear it's needed (probably only useful for local testing of email-alert-frontend, and even then its probably better to test end-to-end in integration).
- details is required in the schema, so remove test for it in the delegation block
- places must not be nil, so remove safe navigation marker in preposition
- Update tests to test #preposition.
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4228 September 18, 2024 15:46 Inactive
@KludgeKML KludgeKML marked this pull request as ready for review September 26, 2024 08:43
@KludgeKML KludgeKML merged commit 607328d into main Sep 26, 2024
12 checks passed
@KludgeKML KludgeKML deleted the improve-coverage branch September 26, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants