-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(EMS-2236): Application - update credit period hint text (#1313)
* fix(EMS-2236): application - update credit period hint text * fix(EMS-2236): application - update credit period with buyer hint text to be a list * fix(EMS-2236): application - update credit period with buyer hint text to be a list
- Loading branch information
Showing
11 changed files
with
102 additions
and
28 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
e2e-tests/commands/insurance/check-credit-period-with-buyer-input.js
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,26 @@ | ||
import insurancePartials from '../../partials/insurance'; | ||
import { POLICY_FIELDS as FIELDS } from '../../content-strings/fields/insurance/policy'; | ||
import { SHARED_CONTRACT_POLICY } from '../../constants/field-ids/insurance/policy'; | ||
|
||
const { CREDIT_PERIOD_WITH_BUYER } = SHARED_CONTRACT_POLICY; | ||
|
||
/** | ||
* checkCreditPeriodWithBuyerInput | ||
* Check "credit period with buyer" label, hint and input. | ||
*/ | ||
const checkCreditPeriodWithBuyerInput = () => { | ||
const fieldId = CREDIT_PERIOD_WITH_BUYER; | ||
const field = insurancePartials.creditPeriodWithBuyerFormField; | ||
|
||
cy.checkText(field.label(), FIELDS.CONTRACT_POLICY[fieldId].LABEL); | ||
|
||
cy.checkText(field.hint.intro(), FIELDS.CONTRACT_POLICY[fieldId].HINT.INTRO); | ||
cy.checkText(field.hint.listItem(1), FIELDS.CONTRACT_POLICY[fieldId].HINT.LIST[0]); | ||
cy.checkText(field.hint.listItem(2), FIELDS.CONTRACT_POLICY[fieldId].HINT.LIST[1]); | ||
cy.checkText(field.hint.listItem(3), FIELDS.CONTRACT_POLICY[fieldId].HINT.LIST[2]); | ||
cy.checkText(field.hint.listItem(4), FIELDS.CONTRACT_POLICY[fieldId].HINT.LIST[3]); | ||
|
||
field.input().should('exist'); | ||
}; | ||
|
||
export default checkCreditPeriodWithBuyerInput; |
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
14 changes: 14 additions & 0 deletions
14
e2e-tests/partials/insurance/creditPeriodWithBuyerFormField.js
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,14 @@ | ||
import { field } from '../../pages/shared'; | ||
import { SHARED_CONTRACT_POLICY } from '../../constants/field-ids/insurance/policy'; | ||
|
||
const { CREDIT_PERIOD_WITH_BUYER: FIELD_ID } = SHARED_CONTRACT_POLICY; | ||
|
||
const creditPeriodWithBuyerFormField = { | ||
...field(FIELD_ID), | ||
hint: { | ||
intro: () => cy.get(`[data-cy="${FIELD_ID}-hint-intro"]`), | ||
listItem: (index) => cy.get(`[data-cy="${FIELD_ID}-hint-list-item-${index}"]`), | ||
}, | ||
}; | ||
|
||
export default creditPeriodWithBuyerFormField; |
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
14 changes: 14 additions & 0 deletions
14
src/ui/templates/components/credit-period-with-buyer-hint.njk
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,14 @@ | ||
{% macro render(params) %} | ||
|
||
{% set ID = params.id %} | ||
{% set HINT = params.hint %} | ||
|
||
<p data-cy="{{ ID }}-hint-intro">{{ HINT.INTRO }}</p> | ||
|
||
<ul class="govuk-list govuk-list--bullet"> | ||
{% for ITEM in HINT.LIST %} | ||
<li class="govuk-hint" data-cy="{{ ID }}-hint-list-item-{{ loop.index }}">{{ ITEM }}</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
{% endmacro %} |
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