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

update 'no-errors' page design & content #610

Merged
merged 8 commits into from
Nov 7, 2024

Conversation

rosado
Copy link
Collaborator

@rosado rosado commented Oct 31, 2024

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

  • Feature

Description

Update design and content of the 'no-errors' template, and a deep link into the check tool.

Related Tickets & Documents

QA Instructions, Screenshots, Recordings

Top of the page now looks like this:
image

Bottom of the page looks like this:
image

Added/updated tests?

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

  • Yes

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

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

Summary by CodeRabbit

  • New Features

    • Enhanced user interface on the "no errors" page, displaying the number of rows ready for publication.
    • Improved page title clarity by indicating errors and pagination information.
  • Bug Fixes

    • Streamlined form interactions by removing unnecessary elements and ensuring data correctness prompts are clear.
  • Tests

    • Updated acceptance and integration tests to reflect changes in the user interface and improve assertion flexibility.

Copy link
Contributor

coderabbitai bot commented Oct 31, 2024

Walkthrough

The changes in this pull request primarily involve updates to the HTML template and associated test files. The HTML file now includes a conditional block for setting the checkToolLink variable based on the dataset's presence, modifies the page title logic, and streamlines the user interface by removing unnecessary elements. In the test files, several methods and assertions have been adjusted to accommodate these changes, particularly focusing on dynamic content rather than static checks.

Changes

File Change Summary
src/views/check/results/no-errors.html - Added conditional block for checkToolLink based on dataset presence.
- Updated page title logic to prefix with "Error:" and include pagination info.
- Changed main heading to show number of rows ready for publication.
- Removed error summary block and introduced a new form with a hidden input for dataLooksCorrect.
test/PageObjectModels/resultsPage.js - Updated expectPageIsNoErrorsPage method to use regex for dynamic header text instead of static check.
test/acceptance/request_check.test.js - Removed await resultsPage.selectLabel('Yes') from two test cases, simplifying the flow.
test/integration/test_recieving_results.playwright.test.js - Updated successful result test case assertion to use regex for flexible text matching.
- Improved loop syntax for iterating over issues.
test/integration/validation_errors.playwright.test.js - Removed a test case for error handling on the "no errors" page and deleted the import statement for NoErrorsPage.

Possibly related PRs

Suggested reviewers

  • GeorgeGoodall-GovUk

🐰 In a world where data flows,
A rabbit hops where clarity grows.
With links that check and titles bright,
We publish rows, oh what a sight!
No errors here, just a joyful cheer,
For every change, we hold dear! 🥕✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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.

Copy link

github-actions bot commented Oct 31, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 63.04% 3729 / 5915
🔵 Statements 63.04% 3729 / 5915
🔵 Functions 64.65% 161 / 249
🔵 Branches 81.09% 446 / 550
File CoverageNo changed files found.
Generated in workflow #199 for commit b67e606 by the Vitest Coverage Report Action

@rosado rosado force-pushed the rosado/571-content-and-styling-1 branch from 98a0306 to a1b23fd Compare November 6, 2024 12:36
@rosado rosado marked this pull request as ready for review November 6, 2024 12:53
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (3)
test/PageObjectModels/resultsPage.js (1)

19-19: Consider making the regex pattern more specific.

The current pattern /You have \d+ row.* ready to publish/ works but could be more precise. A more specific pattern would better document the expected format and catch potential issues.

Consider using this pattern instead:

-    expect(await this.page.locator('h1').innerText()).toMatch(/You have \d+ row.* ready to publish/)
+    expect(await this.page.locator('h1').innerText()).toMatch(/You have \d+ row(?:s)? ready to publish/)
src/views/check/results/no-errors.html (1)

48-48: Consider adding ARIA attributes for screen readers.

While the dynamic heading is informative, consider adding ARIA attributes to enhance accessibility when the count changes.

-        You have {{options.pagination.totalResults}} {{ "row" | pluralise(options.pagination.totalResults) }} ready to publish
+        You have <span aria-live="polite">{{options.pagination.totalResults}} {{ "row" | pluralise(options.pagination.totalResults) }}</span> ready to publish
test/integration/test_recieving_results.playwright.test.js (1)

Line range hint 1-1: Fix the typo in the filename.

The filename contains a spelling error: "recieving" should be "receiving".

Apply this change:

-test/integration/test_recieving_results.playwright.test.js
+test/integration/test_receiving_results.playwright.test.js
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 0c028f3 and a1b23fd.

📒 Files selected for processing (5)
  • src/views/check/results/no-errors.html (3 hunks)
  • test/PageObjectModels/resultsPage.js (1 hunks)
  • test/acceptance/request_check.test.js (0 hunks)
  • test/integration/test_recieving_results.playwright.test.js (1 hunks)
  • test/integration/validation_errors.playwright.test.js (0 hunks)
💤 Files with no reviewable changes (2)
  • test/acceptance/request_check.test.js
  • test/integration/validation_errors.playwright.test.js
🔇 Additional comments (3)
test/PageObjectModels/resultsPage.js (1)

19-19: Consider adding test cases for different row counts.

The method now handles dynamic content, but it would be beneficial to verify it works correctly with different scenarios.

Let's check if there are any existing test cases:

Would you like me to help create additional test cases to verify the behaviour with:

  • Single row (singular form)
  • Multiple rows (plural form)
  • Large number of rows
src/views/check/results/no-errors.html (1)

20-24: LGTM! Verify deep link generation.

The conditional logic for setting checkToolLink is well-structured with a proper fallback.

Let's verify the deep link generation implementation:

✅ Verification successful

Deep link implementation is properly tested and secure

The checkToolDeepLink filter is well-implemented with:

  • Proper URL encoding of parameters to prevent injection
  • Clear type definitions and documentation
  • Comprehensive test coverage for both valid and invalid scenarios
  • Correct registration in the filters module

The conditional usage in no-errors.html aligns perfectly with the implementation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the checkToolDeepLink filter implementation
# Expected: Find the filter implementation to ensure it handles all edge cases

# Search for the checkToolDeepLink filter implementation
rg -l "checkToolDeepLink"

# Search for tests covering the deep link generation
rg -l "test.*checkToolDeepLink|describe.*checkToolDeepLink"

Length of output: 377


Script:

#!/bin/bash
# Let's examine the implementation and test coverage

# Check the filter implementation
cat src/filters/checkToolDeepLink.js

# Check the test implementation
cat test/unit/deepLinkController.test.js

# Check how it's registered in filters
cat src/filters/filters.js

Length of output: 4065

test/integration/test_recieving_results.playwright.test.js (1)

27-27: LGTM! The regex pattern accommodates dynamic row counts.

The updated assertion using a regular expression pattern /You have \d+ row.* ready to publish/ is more flexible and aligns well with the dynamic content changes in the 'no-errors' page.

src/views/check/results/no-errors.html Show resolved Hide resolved
@eveleighoj eveleighoj temporarily deployed to submit-pr-610 November 7, 2024 13:47 Inactive
Copy link
Contributor

@GeorgeGoodall-GovUk GeorgeGoodall-GovUk left a comment

Choose a reason for hiding this comment

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

lgtm

@rosado rosado merged commit ef6e241 into main Nov 7, 2024
5 checks passed
@rosado rosado deleted the rosado/571-content-and-styling-1 branch November 7, 2024 14:05
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