generated from ministryofjustice/hmpps-template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
128e0cf
commit dddb36c
Showing
28 changed files
with
1,372 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
.govuk-main-wrapper { | ||
min-height: 600px; | ||
} | ||
|
||
.govuk-\!-width-auto { | ||
width: auto !important; | ||
} | ||
|
||
.secondary-text { | ||
color: $govuk-secondary-text-colour; | ||
@include govuk-font-size($size: 16); | ||
} | ||
|
||
.moj-filter__header { | ||
display: none; | ||
} | ||
|
||
.moj-filter__options .moj-datepicker input { | ||
max-width: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import Page from '../pages/page' | ||
import IndexPage from '../pages' | ||
|
||
context('List page', () => { | ||
it('can filter results', () => { | ||
cy.visit('/') | ||
Page.verifyOnPage(IndexPage) | ||
|
||
// Starts with 2 results | ||
cy.get('#result-count').should('contain.text', 'Showing 2 results.') | ||
cy.get('table tbody tr.govuk-table__row').should('have.length', 2) | ||
|
||
// Filter on template + status | ||
cy.get('#template').click() | ||
cy.get('#status').click() | ||
cy.get('#apply-filters-button').click() | ||
|
||
// Now has 1 result, and 2 filters applied | ||
cy.get('#result-count').should('contain.text', 'Showing 1 result.') | ||
cy.get('table tbody tr.govuk-table__row').should('have.length', 1) | ||
cy.get('.moj-filter__selected').should('exist').should('contain.text', 'Selected filters') | ||
cy.get('.moj-filter__tag').should('have.length', 2) | ||
|
||
// Remove first filter | ||
cy.get('.moj-filter__tag').first().click() | ||
cy.get('#result-count').should('contain.text', 'Showing 2 results.') | ||
cy.get('table tbody tr.govuk-table__row').should('have.length', 2) | ||
cy.get('.moj-filter__selected').should('exist').should('contain.text', 'Selected filters') | ||
cy.get('.moj-filter__tag').should('have.length', 1) | ||
|
||
// Clear all filters | ||
cy.get('.moj-filter__heading-action a').click() | ||
cy.get('.moj-filter__selected').should('not.exist') | ||
cy.get('.moj-filter__tag').should('not.exist') | ||
}) | ||
|
||
it('can search for keywords from message body', () => { | ||
cy.visit('/') | ||
|
||
cy.get('#keywords').type('test2') | ||
cy.get('#apply-filters-button').click() | ||
|
||
cy.get('#keywords').should('have.value', 'test2') | ||
cy.get('#result-count').should('contain.text', 'Showing 1 result.') | ||
cy.get('table tbody tr.govuk-table__row').should('have.length', 1).should('contain.text', 'Dear Test2') | ||
}) | ||
|
||
it('can search for CRN', () => { | ||
cy.visit('/') | ||
|
||
cy.get('#keywords').type('A000001') | ||
cy.get('#apply-filters-button').click() | ||
|
||
cy.get('#keywords').should('have.value', 'A000001') | ||
cy.get('#result-count').should('contain.text', 'Showing 1 result.') | ||
cy.get('table tbody tr.govuk-table__row').should('have.length', 1).should('contain.text', 'A000001') | ||
}) | ||
|
||
it('can search for phone number', () => { | ||
cy.visit('/') | ||
|
||
cy.get('#keywords').type('07700900000') | ||
cy.get('#apply-filters-button').click() | ||
|
||
cy.get('#keywords').should('have.value', '07700900000') | ||
cy.get('#result-count').should('contain.text', 'Showing 1 result.') | ||
cy.get('table tbody tr.govuk-table__row').should('have.length', 1).should('contain.text', '07700900000') | ||
}) | ||
|
||
it('can navigate to notification screen', () => { | ||
cy.visit('/') | ||
cy.get('table tbody tr.govuk-table__row a').first().click() | ||
cy.get('h1').should('have.text', 'Text message') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
context('Notification page', () => { | ||
it('displays message', () => { | ||
cy.visit('/notification/00000000-0000-0000-0000-000000000001') | ||
cy.get('body').should('contain.text', "'Unpaid Work Appointment Reminder' was sent to 07700900000.") | ||
}) | ||
|
||
it('can navigate back to list screen', () => { | ||
cy.visit('/notification/00000000-0000-0000-0000-000000000001') | ||
cy.get('a.govuk-back-link').click() | ||
cy.get('h1').should('have.text', 'Sent reminders') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.