Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/main/resources/locales/cy/summary-of-publications.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@
"noListsWithCourtTelephoneAndEmail": "Mae’n ddrwg gennym, nid yw’r rhestrau ar gyfer COURTNAME ar gael ar hyn o bryd. Cysylltwch â'r llys/tribiwnlys yn uniongyrchol ar CONTACTNO neu EMAIL am ragor o wybodaeth.",
"noListsWithCourtTelephoneOrEmail": "Mae’n ddrwg gennym, nid yw’r rhestrau ar gyfer COURTNAME ar gael ar hyn o bryd. Cysylltwch â'r llys/tribiwnlys yn uniongyrchol ar COURTCONTACT am ragor o wybodaeth.",
"backButton": "Yn ôl",
"missingCourt": "Llys ar Goll"
"missingCourt": "Llys ar Goll",
"findACourtOrTribunalLink": {
"linkMessage": "Dod o hyd i fanylion cyswllt a gwybodaeth arall am lysoedd a thribiwnlysoedd",
"message": "yng Nghymru a Lloegr, a rhai tribiwnlysoedd heb eu datganoli yn yr Alban.",
"link": "https://www.find-court-tribunal.service.gov.uk/?lng=cy"
}
}
7 changes: 6 additions & 1 deletion src/main/resources/locales/en/summary-of-publications.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@
"noListsWithCourtTelephoneAndEmail": "Sorry, lists for COURTNAME are temporarily not available. Please contact the court/tribunal direct on CONTACTNO or EMAIL for more information.",
"noListsWithCourtTelephoneOrEmail": "Sorry, lists for COURTNAME are temporarily not available. Please contact the court/tribunal direct on COURTCONTACT for more information.",
"backButton": "Back",
"missingCourt": "Missing Court"
"missingCourt": "Missing Court",
"findACourtOrTribunalLink": {
"linkMessage": "Find contact details and other information about courts and tribunals",
"message": "in England and Wales, and some non-devolved tribunals in Scotland.",
"link": "https://www.find-court-tribunal.service.gov.uk"
}
}
4 changes: 4 additions & 0 deletions src/main/views/summary-of-publications.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
{% block content %}
<div class="parent-box">
<h1 class="govuk-heading-l">{{ header }} {{ locationName }}?</h1>
<p class="govuk-body">
<a class="govuk-link" target="_blank" href="{{ findACourtOrTribunalLink.link }}">{{ findACourtOrTribunalLink.linkMessage }}</a>
{{ findACourtOrTribunalLink.message }}
</p>
{% if cautionMessageOverride | length %}
{% if cautionMessageOverride | isHtml %}
<div class="govuk-body">{{ cautionMessageOverride | safe }}</div>
Expand Down
60 changes: 36 additions & 24 deletions src/test/unit/views/summary-of-publications.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('Summary of publications page', () => {

it('should display the telephone and email message', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[4].innerHTML).contains(
expect(body[5].innerHTML).contains(
'Sorry, lists for New Court are temporarily not available. Please contact the court/tribunal direct on 0123456789 or [email protected] for more information.',
'Telephone and email message is not displayed'
);
Expand All @@ -116,7 +116,7 @@ describe('Summary of publications page', () => {

it('should display the telephone only message', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[4].innerHTML).contains(
expect(body[5].innerHTML).contains(
'Sorry, lists for New Court are temporarily not available. Please contact the court/tribunal direct on 0123456789 for more information.',
'Telephone only message is not displayed'
);
Expand All @@ -135,7 +135,7 @@ describe('Summary of publications page', () => {

it('should display the email only message', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[4].innerHTML).contains(
expect(body[5].innerHTML).contains(
'Sorry, lists for New Court are temporarily not available. Please contact the court/tribunal direct on [email protected] for more information.',
'Email only message is not displayed'
);
Expand All @@ -154,7 +154,7 @@ describe('Summary of publications page', () => {

it('should display telephone and email in welsh', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[4].innerHTML).contains(
expect(body[5].innerHTML).contains(
"Mae’n ddrwg gennym, nid yw’r rhestrau ar gyfer New Court ar gael ar hyn o bryd. Cysylltwch â'r llys/tribiwnlys yn uniongyrchol ar 0123456789 neu [email protected] am ragor o wybodaeth.",
'Telephone and email in Welsh is not displayed'
);
Expand All @@ -173,7 +173,7 @@ describe('Summary of publications page', () => {

it('should display the telephone only message in welsh', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[4].innerHTML).contains(
expect(body[5].innerHTML).contains(
"Mae’n ddrwg gennym, nid yw’r rhestrau ar gyfer New Court ar gael ar hyn o bryd. Cysylltwch â'r llys/tribiwnlys yn uniongyrchol ar 0123456789 am ragor o wybodaeth.",
'Telephone only message in Welsh is not displayed'
);
Expand All @@ -192,7 +192,7 @@ describe('Summary of publications page', () => {

it('should display the email only message in welsh', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[4].innerHTML).contains(
expect(body[5].innerHTML).contains(
"Mae’n ddrwg gennym, nid yw’r rhestrau ar gyfer New Court ar gael ar hyn o bryd. Cysylltwch â'r llys/tribiwnlys yn uniongyrchol ar [email protected] am ragor o wybodaeth.",
'Email only message in Welsh is not displayed'
);
Expand All @@ -211,7 +211,7 @@ describe('Summary of publications page', () => {

it('should display no contact information', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[4].innerHTML).contains(
expect(body[5].innerHTML).contains(
'Sorry, no lists found for this court',
'Contact information is displayed'
);
Expand All @@ -230,7 +230,7 @@ describe('Summary of publications page', () => {

it('should display caution message in English', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[4].innerHTML).equals('English caution message');
expect(body[5].innerHTML).equals('English caution message');
});
});

Expand All @@ -246,7 +246,7 @@ describe('Summary of publications page', () => {

it('should display caution message in Welsh', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[4].innerHTML).equals('Welsh caution message');
expect(body[5].innerHTML).equals('Welsh caution message');
});
});

Expand All @@ -262,12 +262,12 @@ describe('Summary of publications page', () => {

it('should display caution message when no list is there in English', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[4].innerHTML).equals('English caution message');
expect(body[5].innerHTML).equals('English caution message');
});

it('should display no list for location message in English', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[5].innerHTML).equals('English no list message');
expect(body[6].innerHTML).equals('English no list message');
});
});

Expand All @@ -283,12 +283,12 @@ describe('Summary of publications page', () => {

it('should display caution message when no list is there in Welsh', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[4].innerHTML).equals('Welsh caution message');
expect(body[5].innerHTML).equals('Welsh caution message');
});

it('should display no list for location message in Welsh', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[5].innerHTML).equals('Welsh no list message');
expect(body[6].innerHTML).equals('Welsh no list message');
});
});

Expand All @@ -304,12 +304,12 @@ describe('Summary of publications page', () => {

it('should display caution message as HTML', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[4].innerHTML).equals('<strong>HTML caution message</strong>');
expect(body[5].innerHTML).equals('<strong>HTML caution message</strong>');
});

it('should display no list message as HTML', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[5].innerHTML).equals('<strong>HTML no list message</strong>');
expect(body[6].innerHTML).equals('<strong>HTML no list message</strong>');
});
});

Expand Down Expand Up @@ -339,6 +339,18 @@ describe('Summary of publications page', () => {
);
});

it('should display link to FaCT', () => {
const text = htmlRes.getElementsByClassName('govuk-body')[4].getElementsByTagName('a');
expect(text[0].innerHTML).contains(
'Find contact details and other information about courts and tribunals',
'Could not find link to FaCT'
);
expect(text[0].getAttribute('href').valueOf()).contains(
'https://www.find-court-tribunal.service.gov.uk',
'Could not find Href for link to FaCT'
);
});

it('should display a back button with the correct value', () => {
const backLink = htmlRes.getElementsByClassName('govuk-back-link');
expect(backLink[0].innerHTML).contains('Back', 'Back button does not contain correct text');
Expand All @@ -347,46 +359,46 @@ describe('Summary of publications page', () => {

it('should display publications', () => {
const body = htmlRes.getElementsByClassName(bodyClass);
expect(body[4].innerHTML).contains(
expect(body[5].innerHTML).contains(
'Select the list you want to view from the link(s) below:',
'Select list text does not match'
);
expect(body[5].innerHTML).contains(
expect(body[6].innerHTML).contains(
'Asylum Support Tribunal Daily Hearing List 19 January 2025 - Welsh (Cymraeg)',
'list type does not match'
);

expect(body[6].innerHTML).contains(
expect(body[7].innerHTML).contains(
'Asylum Support Tribunal Daily Hearing List 18 January 2025 - English (Saesneg)',
'list type does not match'
);

expect(body[7].innerHTML).contains(
expect(body[8].innerHTML).contains(
'Care Standards Tribunal Weekly Hearing List for week commencing 20 January 2025 - English (Saesneg)',
'list type does not match'
);

expect(body[8].innerHTML).contains(
expect(body[9].innerHTML).contains(
'Civil Daily Cause List 22 January 2025 - English (Saesneg)',
'list type does not match'
);

expect(body[9].innerHTML).contains(
expect(body[10].innerHTML).contains(
'Civil Daily Cause List 20 January 2025 - English (Saesneg)',
'list type does not match'
);

expect(body[10].innerHTML).contains(
expect(body[11].innerHTML).contains(
'Civil Daily Cause List 20 January 2025 - Welsh (Cymraeg)',
'list type does not match'
);

expect(body[11].innerHTML).contains(
expect(body[12].innerHTML).contains(
'Family Daily Cause List 21 January 2025 - English (Saesneg)',
'list type does not match'
);

expect(body[12].innerHTML).contains(
expect(body[13].innerHTML).contains(
'Family Daily Cause List 21 January 2025 - Welsh (Cymraeg)',
'list type does not match'
);
Expand Down