Skip to content

Commit

Permalink
MLPAB-1437 Add card design for new LPA (#734)
Browse files Browse the repository at this point in the history
And split out the dashboard fixtures
  • Loading branch information
hawx authored Sep 29, 2023
1 parent 7325768 commit 492c00d
Show file tree
Hide file tree
Showing 22 changed files with 639 additions and 604 deletions.
5 changes: 1 addition & 4 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ coverage:
- "./mocks/*"
- "./internal/identity/yoti*"
- "./internal/telemetry"
- "./internal/page/fixtures.go"
- "./internal/page/attorney_fixtures.go"
- "./internal/page/certificate_provider_fixtures.go"
- "./internal/page/testing_start.go"
- "./internal/page/fixtures"
- "./cmd/mlpa/main.go"
- "./cmd/mock-notify/main.go"
- "./cmd/mock-onelogin/main.go"
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/donor/confirm-your-identity-and-sign.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ describe('Confirm your identity and sign', () => {
cy.contains('a', 'Continue').click();

cy.url().should('contain', '/dashboard');
cy.checkA11yApp();
});

it('can be restarted', () => {
Expand Down
10 changes: 5 additions & 5 deletions cypress/e2e/donor/dashboard.cy.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
describe('Dashboard', () => {
context('with incomplete LPA', () => {
beforeEach(() => {
cy.visit('/testing-start?lpa.yourDetails=1');
cy.visit('/dashboard');
cy.visit('/fixtures/dashboard?asDonor=1&redirect=/dashboard');
});

it('shows my lasting power of attorney', () => {
cy.checkA11yApp();

cy.contains('Property and affairs');
cy.contains('Sam Smith');
cy.contains('a', 'Go to task list').click();
Expand All @@ -14,7 +15,7 @@ describe('Dashboard', () => {
});

it('can create another reusing some previous details', () => {
cy.contains('button', 'Create another LPA').click();
cy.contains('button', 'Start now').click();

cy.get('#f-first-names').clear().type('Jane');
cy.contains('button', 'Continue').click();
Expand Down Expand Up @@ -81,8 +82,7 @@ describe('Dashboard', () => {

context('with various roles', () => {
it('shows all of my LPAs', () => {
cy.visit('/testing-start?lpa.complete=1&attorneyProvided=1&asCertificateProvider=1&fresh=1')
cy.visit('/dashboard');
cy.visit('/fixtures/dashboard?asDonor=1&asAttorney=1&asCertificateProvider=1&redirect=/dashboard');

cy.contains('My LPAs');
cy.contains('I’m an attorney');
Expand Down
11 changes: 7 additions & 4 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/ministryofjustice/opg-modernising-lpa/internal/page/attorney"
"github.com/ministryofjustice/opg-modernising-lpa/internal/page/certificateprovider"
"github.com/ministryofjustice/opg-modernising-lpa/internal/page/donor"
"github.com/ministryofjustice/opg-modernising-lpa/internal/page/fixtures"
"github.com/ministryofjustice/opg-modernising-lpa/internal/pay"
"github.com/ministryofjustice/opg-modernising-lpa/internal/place"
"github.com/ministryofjustice/opg-modernising-lpa/internal/random"
Expand Down Expand Up @@ -99,7 +100,7 @@ func App(

rootMux := http.NewServeMux()

rootMux.Handle(paths.TestingStart.String(), page.TestingStart(sessionStore, donorStore, random.String, localizer, certificateProviderStore, attorneyStore, logger, time.Now))
rootMux.Handle(paths.TestingStart.String(), fixtures.TestingStart(sessionStore, donorStore, random.String, localizer, certificateProviderStore, attorneyStore, logger, time.Now))

handleRoot := makeHandle(rootMux, errorHandler, sessionStore)

Expand All @@ -108,11 +109,13 @@ func App(
handleRoot(paths.SignOut, None,
page.SignOut(logger, sessionStore, oneLoginClient, appPublicURL))
handleRoot(paths.Fixtures, None,
page.Fixtures(tmpls.Get("fixtures.gohtml")))
fixtures.Donor(tmpls.Get("fixtures.gohtml")))
handleRoot(paths.CertificateProviderFixtures, None,
page.CertificateProviderFixtures(tmpls.Get("certificate_provider_fixtures.gohtml"), sessionStore, shareCodeSender, donorStore, certificateProviderStore))
fixtures.CertificateProvider(tmpls.Get("certificate_provider_fixtures.gohtml"), sessionStore, shareCodeSender, donorStore, certificateProviderStore))
handleRoot(paths.AttorneyFixtures, None,
page.AttorneyFixtures(tmpls.Get("attorney_fixtures.gohtml"), sessionStore, shareCodeSender, donorStore, certificateProviderStore, attorneyStore))
fixtures.Attorney(tmpls.Get("attorney_fixtures.gohtml"), sessionStore, shareCodeSender, donorStore, certificateProviderStore, attorneyStore))
handleRoot(paths.DashboardFixtures, None,
fixtures.Dashboard(tmpls.Get("dashboard_fixtures.gohtml"), sessionStore, shareCodeSender, donorStore, certificateProviderStore, attorneyStore))
handleRoot(paths.YourLegalRightsAndResponsibilities, None,
page.Guidance(tmpls.Get("your_legal_rights_and_responsibilities_general.gohtml")))
handleRoot(page.Paths.Start, None,
Expand Down
201 changes: 0 additions & 201 deletions internal/page/certificate_provider_fixtures.go

This file was deleted.

13 changes: 0 additions & 13 deletions internal/page/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,6 @@ type DonorStore interface {
Put(context.Context, *Lpa) error
}

//go:generate mockery --testonly --inpackage --name CertificateProviderStore --structname mockCertificateProviderStore
type CertificateProviderStore interface {
Create(context.Context, string) (*actor.CertificateProviderProvidedDetails, error)
Put(context.Context, *actor.CertificateProviderProvidedDetails) error
}

//go:generate mockery --testonly --inpackage --name AttorneyStore --structname mockAttorneyStore
type AttorneyStore interface {
Create(context.Context, string, string, bool, bool) (*actor.AttorneyProvidedDetails, error)
Put(context.Context, *actor.AttorneyProvidedDetails) error
}

//go:generate mockery --testonly --inpackage --name SessionStore --structname mockSessionStore
type SessionStore interface {
Get(r *http.Request, name string) (*sessions.Session, error)
Expand Down Expand Up @@ -92,7 +80,6 @@ type Localizer interface {
type shareCodeSender interface {
SendCertificateProvider(ctx context.Context, template notify.Template, appData AppData, identity bool, lpa *Lpa) error
SendAttorneys(ctx context.Context, appData AppData, lpa *Lpa) error
UseTestCode()
}

func PostFormString(r *http.Request, name string) string {
Expand Down
Loading

0 comments on commit 492c00d

Please sign in to comment.