From 08995cebe5b1315deaeb128b2685d2910d64aa7e Mon Sep 17 00:00:00 2001 From: Thomas McGowan Date: Tue, 4 Feb 2025 13:29:01 +0000 Subject: [PATCH] VB-5151 Update table availability text on Select date/time page (#929) --- server/views/pages/bookAVisit/dateAndTime.njk | 2 +- server/views/pages/bookAVisit/dateAndTime.test.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/views/pages/bookAVisit/dateAndTime.njk b/server/views/pages/bookAVisit/dateAndTime.njk index f9cc1c9d..0c7b82d8 100644 --- a/server/views/pages/bookAVisit/dateAndTime.njk +++ b/server/views/pages/bookAVisit/dateAndTime.njk @@ -33,7 +33,7 @@
{{ slot.capacity + (slot.availableTables | abs) }} of {{ slot.capacity}} {{ "table" | pluralise(slot.capacity) }} booked {%- else -%} - {{ slot.availableTables }} {{ "table" | pluralise(slot.availableTables) }} available + {{ slot.availableTables }} {{ "table" | pluralise(slot.availableTables) }} available of {{ slot.capacity }} {{ "table" | pluralise(slot.capacity) }} {%- endif %} {% endset %} diff --git a/server/views/pages/bookAVisit/dateAndTime.test.ts b/server/views/pages/bookAVisit/dateAndTime.test.ts index 0074e1a6..c16ce9af 100644 --- a/server/views/pages/bookAVisit/dateAndTime.test.ts +++ b/server/views/pages/bookAVisit/dateAndTime.test.ts @@ -162,9 +162,9 @@ describe('Views - Date and time of visit', () => { expect($('#slots-month-February2022-heading-1').text().trim()).toBe('Monday 14 February') expect($('#slots-month-February2022-content-1 h3').eq(0).text()).toBe('Morning') expect($('label[for="1"]').text()).toContain('10am to 11am') - expect($('label[for="1"]').text()).toContain('15 tables available') + expect($('label[for="1"]').text()).toContain('15 tables available of 30 tables') expect($('label[for="2"]').text()).toContain('11:59am to 12:59pm') - expect($('label[for="2"]').text()).toContain('1 table available') + expect($('label[for="2"]').text()).toContain('1 table available of 30 tables') expect($('label[for="3"]').text()).toContain('12pm to 1:05pm') expect($('label[for="3"]').text()).toContain('Prisoner has a visit') expect($('#3').attr('disabled')).toBe('disabled') @@ -252,7 +252,7 @@ describe('Views - Date and time of visit', () => { expect($('#1').prop('checked')).toBe(false) expect($('label[for="1"]').text()).toContain('10am to 11am') - expect($('label[for="1"]').text()).toContain('15 tables available') + expect($('label[for="1"]').text()).toContain('15 tables available of 30 tables') }) it('should correctly label currently reserved slot when booking a visit', () => {