Skip to content

hmcts/probate-caveats-frontend

Repository files navigation

Probate Caveats Frontend

License: MITQuality Gate Status Security Rating Vulnerabilities Coverage

This is the frontend caveats application for the Probate Caveats online service. The service provides a clear interface for citizens, presented as sequence of HTML 5 web pages designed to GDS Service Design guidelines, so that they can check that they're eligible to apply for Caveats online.

Overview

probate-frontendprobate-caveats-frontendprobate-back-officeprobate-orchestrator-serviceprobate-business-serviceprobate-submit-serviceprobate-persistence-service


Citizen view
Caseworker view

Getting Started

Prerequisites

Installation

Install dependencies by executing the following command:

$ yarn install

Compile SASS stylesheets by running the following command:

$ yarn setup

Build a git.properties.json by running the following command:

$ yarn git-info

Note. if setting up on an M1 with ARM architecure, and node-sass is not successfully installing, make sure you're using node version 15

Git hooks:

We have git hooks that enforce rules for commit messages.

These can be activated by running the following commands:

$ ln -s ../../pre-commit.sh .git/hooks/pre-commit
$ ln -s ../../commit-msg.sh .git/hooks/commit-msg

Running the application

Run the application local server:

$ yarn start:ld

The application can be completed locally at https://localhost:3000, provided all services are running in the background as described in the next section.

add a dev.yaml file to the /config folder with contents if you want to run LauchDarkly locally

Running the other services in Docker

To run probate-frontend with the other services locally you will need to clone and run the following services:

  • probate-back-office: https://github.com/hmcts/probate-back-office - Follow the instructions in probate-back-office/compose/README.md.
  • probate-orchestrator-service: https://github.com/hmcts/probate-orchestrator-service - Follow the instructions in probate-orchestrator-service/README.md
  • probate-submit-service: https://github.com/hmcts/probate-submit-service - Follow the instructions in probate-submit-service/README.md

Running the application locally with backend pointing to AAT

Install Redis to local machine i.e.

$ brew install Redis

Then run Redis server from where redis was installed to

$ redis-server

Run the application local server alongside Redis server:

$ yarn start:dev:ld:aat

The application can be completed locally at https://localhost:3001. Caveats will appear in AAT.

Developing

Code style

Before submitting a Pull Request you will be required to run $ yarn eslint (which is also run automatically when trying to commit anyway).

We have a number of rules relating to code style that can be found in .eslintrc.js.

Config

For development only config, rename the config/dev_template.yaml file to config/dev.yaml. Running the app with the node environment set to dev will ensure this file is used. This file is not version controlled so any config here will not be pushed to git.

As an example, if you want to use LanuchDarkly locally, place the SDK Key in this file. You can keep the key there as this file is not version controlled.

Running the tests

Mocha is used for writing tests.

The test suite can be run with: $ yarn test

For unit tests: $ yarn test-unit

For component tests: $ yarn test-component

For accessibility tests: $ yarn test-accessibility

For test coverage: $ yarn test:coverage

Running tests on the pipeline

If you are concerned about the impact of your code changes, you may want to run a more comprehensive set of tests as part of the PR build. To do this, you can add the appropriate label to the PR (in GitHub), as detailed below:

  • nightly: This will run yarn test:fullfunctional command.
  • nightly-without-welsh-tests: This will run yarn test:fullfunctional command but only in English language.

License

This project is licensed under the MIT License - see the LICENSE file for details