Skip to content

Update confirmation.html - #1072

Merged
maddie-broxup merged 6 commits into
mainfrom
maddie-broxup-patch-7
Jul 8, 2025
Merged

Update confirmation.html#1072
maddie-broxup merged 6 commits into
mainfrom
maddie-broxup-patch-7

Conversation

@maddie-broxup

@maddie-broxup maddie-broxup commented Jul 7, 2025

Copy link
Copy Markdown
Contributor

Content tweaks to reflect new service name

Description

Content tweaks to reflect new service name from 'submit' to 'provide'

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Related Tickets & Documents

#1013

  • Closes #

QA Instructions, Screenshots, Recordings

Before

Before screenshot here

After

After screenshot here

Added/updated tests?

We encourage you to keep the code coverage percentage at 80% and above.

  • Yes
  • No, and this is why: Please replace this line with details on why tests have not been included
  • I need help with writing tests

QA sign off

  • Code has been checked and approved
  • Design has been checked and approved
  • Product and business logic has been checked and proved

[optional] Are there any post-deployment tasks we need to perform?

[optional] Are there any dependencies on other PRs or Work?

Summary by CodeRabbit

  • Style

    • Updated terminology from "Submit" to "Provide" across confirmation and related pages for clearer user communication.
    • Revised service name wording to "Check and provide your planning data" for improved clarity.
  • Tests

    • Updated test assertions to reflect the revised terminology on confirmation and related pages.

Content tweaks to reflect new service name
@coderabbitai

coderabbitai Bot commented Jul 7, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The terminology in multiple view templates and their corresponding tests was updated, changing references from "Submit" and "submitted" to "Check and provide" and "provided." This includes updates to page titles, headings, and configuration values. No other logic, content, or exported/public entities were altered.

Changes

File(s) Change Summary
src/views/submit/confirmation.html Updated template variable to use "provided" instead of "submitted" in the confirmation page.
config/default.yaml Changed submit key in serviceNames from "Submit your planning data" to "Check and provide your planning data".
test/unit/endpointSubmissionForm/confirmationPage.test.js Updated test assertions to expect "provided" instead of "submitted" in the confirmation page title and heading.
test/unit/views/submit/check-answers.test.js, test/unit/views/submit/choose-datasetPage.test.js, test/unit/views/submit/dataset-details.test.js, test/unit/views/submit/lpa-detailsPage.test.js Updated page title assertions in tests to replace "Submit your planning data" with "Check and provide your planning data".

Poem

A bunny hopped with nimble pride,
"Submit" now rests, "Provide" beside.
The page and tests in gentle stride,
Embrace new words, old terms aside.
With every change, the code’s refined—
🥕 Cheers to clarity, well-aligned!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6393d19 and 37b920f.

📒 Files selected for processing (7)
  • config/default.yaml (1 hunks)
  • src/views/submit/confirmation.html (1 hunks)
  • test/unit/endpointSubmissionForm/confirmationPage.test.js (1 hunks)
  • test/unit/views/submit/check-answers.test.js (1 hunks)
  • test/unit/views/submit/choose-datasetPage.test.js (1 hunks)
  • test/unit/views/submit/dataset-details.test.js (1 hunks)
  • test/unit/views/submit/lpa-detailsPage.test.js (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • config/default.yaml
  • test/unit/views/submit/dataset-details.test.js
  • test/unit/views/submit/choose-datasetPage.test.js
  • test/unit/views/submit/check-answers.test.js
  • test/unit/views/submit/lpa-detailsPage.test.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/views/submit/confirmation.html
🧰 Additional context used
🧠 Learnings (1)
test/unit/endpointSubmissionForm/confirmationPage.test.js (2)
Learnt from: GeorgeGoodall-GovUk
PR: digital-land/submit#609
File: test/unit/noErrorsPage.test.js:68-68
Timestamp: 2024-11-12T10:54:09.485Z
Learning: In `test/unit/noErrorsPage.test.js`, avoid using `prettifyColumnName` for column headers because the table can contain spec fields, as requested by Alex.
Learnt from: GeorgeGoodall-GovUk
PR: digital-land/submit#510
File: test/unit/middleware/datasetOverview.middleware.test.js:1-3
Timestamp: 2024-10-21T08:57:17.338Z
Learning: Tests for `pullOutDatasetSpecification` have been moved to `common.middleware.test`.
🪛 Biome (1.9.4)
test/unit/endpointSubmissionForm/confirmationPage.test.js

[error] 24-24: Use a regular expression literal instead of the RegExp constructor.

Regular expression literals avoid some escaping required in a string literal, and are easier to analyze statically.
Safe fix: Use a literal notation instead.

(lint/complexity/useRegexLiterals)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: run-tests / test
🔇 Additional comments (1)
test/unit/endpointSubmissionForm/confirmationPage.test.js (1)

20-20: LGTM: Page title assertion updated correctly.

The page title assertion has been properly updated to reflect the new service terminology from "submit" to "provide".

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions

github-actions Bot commented Jul 7, 2025

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 66.41% 5956 / 8968
🔵 Statements 66.41% 5956 / 8968
🔵 Functions 64.87% 253 / 390
🔵 Branches 79.7% 758 / 951
File CoverageNo changed files found.
Generated in workflow #1107 for commit 65e4869 by the Vitest Coverage Report Action

@stevenjmesser

Copy link
Copy Markdown
Contributor

CodeRabbit raised some suggested changes to tests on #1069, which might resolve some of the errors with tests seen here. I’ll take a look shortly.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/views/submit/confirmation.html (1)

6-7: Service name string is hard-coded – consider centralising
Embedding 'Provide' directly in every template risks divergence if the service name changes again. A single source of truth (e.g. a Nunjucks global or app-level config) would prevent future drift.

test/unit/endpointSubmissionForm/confirmationPage.test.js (2)

10-10: Test suite description still refers to “Submit”
The describe block name hasn’t been updated, which can confuse future greps and reporters.

-describe('Submit confirmation View', () => {
+describe('Provide confirmation view', () => {

24-26: Prefer regex literal over RegExp constructor
Static-analysis warning:

-const regex = new RegExp('<h1 class="govuk-panel__title".*mockDataset provided.*</h1>', 'g')
+const regex = /<h1 class="govuk-panel__title".*mockDataset provided.*<\/h1>/g

Reduces escaping noise and satisfies Biome rule useRegexLiterals.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3fe4172 and 95c6f13.

📒 Files selected for processing (2)
  • src/views/submit/confirmation.html (1 hunks)
  • test/unit/endpointSubmissionForm/confirmationPage.test.js (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
test/unit/endpointSubmissionForm/confirmationPage.test.js (2)
Learnt from: GeorgeGoodall-GovUk
PR: digital-land/submit#609
File: test/unit/noErrorsPage.test.js:68-68
Timestamp: 2024-11-12T10:54:09.485Z
Learning: In `test/unit/noErrorsPage.test.js`, avoid using `prettifyColumnName` for column headers because the table can contain spec fields, as requested by Alex.
Learnt from: GeorgeGoodall-GovUk
PR: digital-land/submit#510
File: test/unit/middleware/datasetOverview.middleware.test.js:1-3
Timestamp: 2024-10-21T08:57:17.338Z
Learning: Tests for `pullOutDatasetSpecification` have been moved to `common.middleware.test`.
🪛 Biome (1.9.4)
test/unit/endpointSubmissionForm/confirmationPage.test.js

[error] 24-24: Use a regular expression literal instead of the RegExp constructor.

Regular expression literals avoid some escaping required in a string literal, and are easier to analyze statically.
Safe fix: Use a literal notation instead.

(lint/complexity/useRegexLiterals)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test
  • GitHub Check: run-tests / test
🔇 Additional comments (1)
test/unit/endpointSubmissionForm/confirmationPage.test.js (1)

20-21: Page-title expectation retains old branding
If the public-facing copy has moved to Provide your planning data, the assertion should follow suit; otherwise we’re encoding legacy wording.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
test/unit/endpointSubmissionForm/confirmationPage.test.js (1)

24-24: Terminology update is correct, but consider using regex literal.

The change from "submitted" to "provided" aligns with the service rebranding. However, as suggested by the static analysis tool, using a regex literal would improve readability and performance.

Apply this diff to use regex literal:

-    const regex = new RegExp('<h1 class="govuk-panel__title".*mockDataset provided.*</h1>', 'g')
+    const regex = /<h1 class="govuk-panel__title".*mockDataset provided.*<\/h1>/g
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 95c6f13 and 6393d19.

📒 Files selected for processing (1)
  • test/unit/endpointSubmissionForm/confirmationPage.test.js (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
test/unit/endpointSubmissionForm/confirmationPage.test.js (2)
Learnt from: GeorgeGoodall-GovUk
PR: digital-land/submit#609
File: test/unit/noErrorsPage.test.js:68-68
Timestamp: 2024-11-12T10:54:09.485Z
Learning: In `test/unit/noErrorsPage.test.js`, avoid using `prettifyColumnName` for column headers because the table can contain spec fields, as requested by Alex.
Learnt from: GeorgeGoodall-GovUk
PR: digital-land/submit#510
File: test/unit/middleware/datasetOverview.middleware.test.js:1-3
Timestamp: 2024-10-21T08:57:17.338Z
Learning: Tests for `pullOutDatasetSpecification` have been moved to `common.middleware.test`.
🪛 Biome (1.9.4)
test/unit/endpointSubmissionForm/confirmationPage.test.js

[error] 24-24: Use a regular expression literal instead of the RegExp constructor.

Regular expression literals avoid some escaping required in a string literal, and are easier to analyze statically.
Safe fix: Use a literal notation instead.

(lint/complexity/useRegexLiterals)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test
  • GitHub Check: run-tests / test
🔇 Additional comments (1)
test/unit/endpointSubmissionForm/confirmationPage.test.js (1)

20-20: LGTM! Terminology update aligns with service rebranding.

The page title change from "submitted" to "provided" correctly reflects the service name change from "submit" to "provide" as outlined in the PR objectives.

@stevenjmesser

Copy link
Copy Markdown
Contributor

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 7, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Full review triggered.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
test/unit/endpointSubmissionForm/confirmationPage.test.js (1)

24-24: Use a regular expression literal for better readability.

The static analysis tool correctly identifies that using a regex literal would be more readable and efficient than the RegExp constructor.

Apply this diff to use a regex literal:

-    const regex = new RegExp('<h1 class="govuk-panel__title".*mockDataset provided.*</h1>', 'g')
+    const regex = /<h1 class="govuk-panel__title".*mockDataset provided.*<\/h1>/g
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3fe4172 and 6393d19.

📒 Files selected for processing (2)
  • src/views/submit/confirmation.html (1 hunks)
  • test/unit/endpointSubmissionForm/confirmationPage.test.js (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
test/unit/endpointSubmissionForm/confirmationPage.test.js (2)
Learnt from: GeorgeGoodall-GovUk
PR: digital-land/submit#609
File: test/unit/noErrorsPage.test.js:68-68
Timestamp: 2024-11-12T10:54:09.485Z
Learning: In `test/unit/noErrorsPage.test.js`, avoid using `prettifyColumnName` for column headers because the table can contain spec fields, as requested by Alex.
Learnt from: GeorgeGoodall-GovUk
PR: digital-land/submit#510
File: test/unit/middleware/datasetOverview.middleware.test.js:1-3
Timestamp: 2024-10-21T08:57:17.338Z
Learning: Tests for `pullOutDatasetSpecification` have been moved to `common.middleware.test`.
🪛 Biome (1.9.4)
test/unit/endpointSubmissionForm/confirmationPage.test.js

[error] 24-24: Use a regular expression literal instead of the RegExp constructor.

Regular expression literals avoid some escaping required in a string literal, and are easier to analyze statically.
Safe fix: Use a literal notation instead.

(lint/complexity/useRegexLiterals)

🪛 GitHub Actions: Unit test coverage report
test/unit/endpointSubmissionForm/confirmationPage.test.js

[error] 30-30: Test failure: expected document title 'mockDataset provided - Provide' to be 'mockDataset provided - Provide your planning data'. AssertionError due to Object.is equality mismatch.

🪛 GitHub Actions: Code change pipeline to development by @stevenjmesser
test/unit/endpointSubmissionForm/confirmationPage.test.js

[error] 30-30: Test failure: expected document title 'mockDataset provided - Provide' to be 'mockDataset provided - Provide your planning data'. AssertionError due to title mismatch.

🔇 Additional comments (1)
src/views/submit/confirmation.html (1)

6-7: LGTM! Terminology updates are consistent.

The service type and page name changes correctly reflect the rebranding from "Submit" to "Provide" terminology. These variables are properly used in the template layout and panel title respectively.


runGenericPageTests(html, {
pageTitle: 'mockDataset submitted - Submit your planning data'
pageTitle: 'mockDataset provided - Provide your planning data'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify the page title assertion against pipeline failures.

The pipeline failures indicate a mismatch between expected and actual document titles. The test expects 'mockDataset provided - Provide your planning data' but the actual result appears to be 'mockDataset provided - Provide'. This suggests the serviceType variable might not be generating the full expected title in the layout template.

Let me verify how the page title is constructed in the layout template:


🏁 Script executed:

#!/bin/bash
# Description: Check how the page title is constructed in the layout template
# Expected: Find the layout template and see how serviceType and pageName are used to construct the title

# Search for the main layout template that uses serviceType and pageName
rg -A 10 -B 5 "serviceType.*pageName|pageName.*serviceType" --type html

# Also search for title construction patterns
rg -A 5 -B 5 "<title>" --type html

Length of output: 110


I couldn’t locate the title construction in the last search―let’s broaden our scope to search all relevant files for pageTitle, document.title, and <title> usage:


🏁 Script executed:

#!/bin/bash
# Search for pageTitle property in JS/TS files
rg -H -n "pageTitle" --glob "*.{js,jsx,ts,tsx}"

# Search for direct document.title assignments in JS/TS files
rg -H -n "document\\.title" --glob "*.{js,jsx,ts,tsx}"

# Find <title> tags in HTML and Nunjucks templates
fd --extension html --extension njk | xargs rg -H -n "<title"

Length of output: 2719


Let’s locate the confirmationPage view and inspect how its pageTitle is built, plus verify the value of serviceNames.submit:


🏁 Script executed:

#!/bin/bash
# 1. Find the confirmationPage view file(s)
fd --type f -I confirmationPage src

# 2. Show how pageTitle is set in that file
fd --type f -I confirmationPage src | xargs rg -H -n "pageTitle"

# 3. Locate the config file defining serviceNames.submit
rg -H -n "serviceNames" -n src

Length of output: 4353


Let’s inspect the test and relevant templates to confirm how the title is composed and spot the regex usage:


🏁 Script executed:

#!/bin/bash
# 1. Show the confirmationPage test
sed -n '1,200p' test/unit/endpointSubmissionForm/confirmationPage.test.js

# 2. Inspect the endpoint-submitted view template
sed -n '1,50p' src/views/endpoint-submitted.html

# 3. Inspect the main layout template for the pageTitle block
sed -n '1,50p' src/views/layouts/main.html

Length of output: 3365


I still can’t see the submit/confirmation template—let’s pull in its pageTitle block to confirm the missing text:


🏁 Script executed:

#!/bin/bash
# Show the pageTitle override in the submit confirmation template
sed -n '1,30p' src/views/submit/confirmation.html

Length of output: 1002


Fix page title generation & switch to regex literal

  • The confirmation page title is currently rendered as “mockDataset provided – Provide” because there’s no entry for provide in your serviceNames mapping. Please update your configuration (wherever config.serviceNames is defined) to include:

    provide: 'Provide your planning data',
  • In test/unit/endpointSubmissionForm/confirmationPage.test.js, replace the RegExp constructor with a literal for better readability and performance:

     test/unit/endpointSubmissionForm/confirmationPage.test.js
    - const regex = new RegExp('<h1 class="govuk-panel__title".*mockDataset provided.*</h1>', 'g')
    + const regex = /<h1 class="govuk-panel__title".*mockDataset provided.*<\/h1>/g
🤖 Prompt for AI Agents
In test/unit/endpointSubmissionForm/confirmationPage.test.js at line 20, update
the config.serviceNames object to include the key 'provide' with the value
'Provide your planning data' to fix the page title rendering issue. Then,
replace the RegExp constructor used in the test with a regex literal to improve
readability and performance.

@stevenjmesser stevenjmesser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I had to tweak this PR as the page name and title is provided by the serviceNames key, which meant I also had to update the other tests for page titles. All tests now passing – and I decided against changing the submit key to provide as it would probably bring some refactoring – so approved.

@maddie-broxup
maddie-broxup merged commit eb09e5c into main Jul 8, 2025
5 checks passed
@maddie-broxup
maddie-broxup deleted the maddie-broxup-patch-7 branch July 8, 2025 10:50
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.

2 participants