diff --git a/cypress/e2e/02-update/lotOccupancies.cy.d.ts b/cypress/e2e/02-update/lotOccupancies.cy.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/cypress/e2e/02-update/lotOccupancies.cy.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/cypress/e2e/02-update/lotOccupancies.cy.js b/cypress/e2e/02-update/lotOccupancies.cy.js new file mode 100644 index 00000000..934c4e32 --- /dev/null +++ b/cypress/e2e/02-update/lotOccupancies.cy.js @@ -0,0 +1,21 @@ +import { testUpdate } from "../../../test/_globals.js"; +import { logout, login } from "../../support/index.js"; +describe("Update - Lot Occupancies", () => { + before(() => { + logout(); + login(testUpdate); + }); + it('Has a "Create" link on the Lot Occupancy Search', () => { + cy.visit("/lotOccupancies"); + cy.get("a[href$='/lotOccupancies/new']").should("exist"); + }); + describe("Update a New Lot Occupancy", () => { + before(() => { + cy.visit("/lotOccupancies/new"); + }); + it("Has no detectable accessibility issues", () => { + cy.injectAxe(); + cy.checkA11y(); + }); + }); +}); diff --git a/cypress/e2e/02-update/lotOccupancies.cy.ts b/cypress/e2e/02-update/lotOccupancies.cy.ts new file mode 100644 index 00000000..e58559ff --- /dev/null +++ b/cypress/e2e/02-update/lotOccupancies.cy.ts @@ -0,0 +1,26 @@ +import { testUpdate } from "../../../test/_globals.js"; + +import { logout, login } from "../../support/index.js"; + +describe("Update - Lot Occupancies", () => { + before(() => { + logout(); + login(testUpdate); + }); + + it('Has a "Create" link on the Lot Occupancy Search', () => { + cy.visit("/lotOccupancies"); + cy.get("a[href$='/lotOccupancies/new']").should("exist"); + }); + + describe("Update a New Lot Occupancy", () => { + before(() => { + cy.visit("/lotOccupancies/new"); + }); + + it("Has no detectable accessibility issues", () => { + cy.injectAxe(); + cy.checkA11y(); + }); + }); +}); diff --git a/cypress/e2e/02-update/lots.cy.d.ts b/cypress/e2e/02-update/lots.cy.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/cypress/e2e/02-update/lots.cy.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/cypress/e2e/02-update/lots.cy.js b/cypress/e2e/02-update/lots.cy.js new file mode 100644 index 00000000..38a02b1e --- /dev/null +++ b/cypress/e2e/02-update/lots.cy.js @@ -0,0 +1,21 @@ +import { testUpdate } from "../../../test/_globals.js"; +import { logout, login } from "../../support/index.js"; +describe("Update - Lots", () => { + before(() => { + logout(); + login(testUpdate); + }); + it('Has a "Create" link on the Lot Search', () => { + cy.visit("/lots"); + cy.get("a[href$='/lots/new']").should("exist"); + }); + describe("Update a New Lot", () => { + before(() => { + cy.visit("/lots/new"); + }); + it("Has no detectable accessibility issues", () => { + cy.injectAxe(); + cy.checkA11y(); + }); + }); +}); diff --git a/cypress/e2e/02-update/lots.cy.ts b/cypress/e2e/02-update/lots.cy.ts new file mode 100644 index 00000000..9083e481 --- /dev/null +++ b/cypress/e2e/02-update/lots.cy.ts @@ -0,0 +1,26 @@ +import { testUpdate } from "../../../test/_globals.js"; + +import { logout, login } from "../../support/index.js"; + +describe("Update - Lots", () => { + before(() => { + logout(); + login(testUpdate); + }); + + it('Has a "Create" link on the Lot Search', () => { + cy.visit("/lots"); + cy.get("a[href$='/lots/new']").should("exist"); + }); + + describe("Update a New Lot", () => { + before(() => { + cy.visit("/lots/new"); + }); + + it("Has no detectable accessibility issues", () => { + cy.injectAxe(); + cy.checkA11y(); + }); + }); +}); diff --git a/public-typescript/main.js b/public-typescript/main.js index 8c6c92bd..4ea4ad63 100644 --- a/public-typescript/main.js +++ b/public-typescript/main.js @@ -86,10 +86,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); } else { clearButtonElement.dataset.tooltip = "Clear"; + clearButtonElement.ariaLabel = "Clear"; clearButtonElement.innerHTML = ''; } } + const labelElement = document.querySelector("label[for='" + dateElement.id + "']"); + if (labelElement) { + datepickerElement.querySelector(".datetimepicker-dummy-input").ariaLabel = labelElement.textContent; + } } }; const timePickerBaseOptions = { diff --git a/public-typescript/main.ts b/public-typescript/main.ts index a8c41888..750f4393 100644 --- a/public-typescript/main.ts +++ b/public-typescript/main.ts @@ -149,10 +149,19 @@ declare const bulmaJS: BulmaJS; clearButtonElement.remove(); } else { clearButtonElement.dataset.tooltip = "Clear"; + clearButtonElement.ariaLabel = "Clear"; clearButtonElement.innerHTML = ''; } } + + // Apply a label + + const labelElement = document.querySelector("label[for='" + dateElement.id + "']"); + + if (labelElement) { + datepickerElement.querySelector(".datetimepicker-dummy-input").ariaLabel = labelElement.textContent; + } } }; diff --git a/public/javascripts/main.min.js b/public/javascripts/main.min.js index c5920856..cbaaa30c 100644 --- a/public/javascripts/main.min.js +++ b/public/javascripts/main.min.js @@ -1 +1 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=e=>{const t=e.currentTarget.closest(".field").querySelector("input, select");if(t.classList.remove("is-readonly"),"INPUT"===t.tagName)t.readOnly=!1,t.disabled=!1;else{const e=t.querySelectorAll("option");for(const t of e)t.disabled=!1}t.focus()},t={type:"date",dateFormat:"yyyy-MM-dd",showFooter:!1,color:"info",displayMode:"dialog"},o={type:"time",timeFormat:"hh:mm",color:"info",displayMode:"dialog",validateLabel:"Set Time",minuteSteps:1},a=["red","green","orange","blue","pink","yellow","purple"],s=["bright","light","dark"],l={highlightMap:(e,t,o)=>{let a,s=t;for(;!(a=e.querySelector("#"+s))&&s.includes("-");)s=s.slice(0,Math.max(0,s.lastIndexOf("-")));if(a){a.style.fill=null,a.classList.add("highlight","is-"+o);const e=a.querySelectorAll("path");for(const t of e)t.style.fill=null}},initializeUnlockFieldButtons:t=>{const o=t.querySelectorAll(".is-unlock-field-button");for(const t of o)t.addEventListener("click",e)},initializeDatePickers:e=>{const o=e.querySelectorAll("input[type='date']");for(const a of o){const o=Object.assign({},t);a.required&&(o.showClearButton=!1),a.min&&(o.minDate=cityssm.dateStringToDate(a.min)),a.max&&(o.maxDate=cityssm.dateStringToDate(a.max));const s=exports.bulmaCalendar.attach(a,o)[0];s.on("save",()=>{a.value=s.value(),a.dispatchEvent(new Event("change"))}),s.on("show",()=>{document.querySelector("html").classList.add("is-clipped")}),s.on("hide",()=>{bulmaJS.toggleHtmlClipped()});const l=e.querySelector("#"+s._id),n=l.querySelectorAll(".datepicker-nav button.is-text");for(const e of n)e.classList.add("is-"+t.color),e.classList.remove("is-text");const r=l.querySelector(".datetimepicker-clear-button");r&&(a.required?r.remove():(r.dataset.tooltip="Clear",r.innerHTML=''))}},initializeTimePickers:e=>{const t=e.querySelectorAll("input[type='time']");for(const a of t){const t=Object.assign({},o);a.required&&(t.showClearButton=!1);const s=exports.bulmaCalendar.attach(a,t)[0];s.on("save",()=>{a.value=s.value(),a.dispatchEvent(new Event("change"))}),s.on("show",()=>{document.querySelector("html").classList.add("is-clipped")}),s.on("hide",()=>{bulmaJS.toggleHtmlClipped()});const l=e.querySelector("#"+s._id),n=l.querySelector(".datetimepicker-footer-cancel");n&&n.remove();const r=l.querySelector(".datetimepicker-clear-button");r&&(a.required?r.remove():(r.dataset.tooltip="Clear",r.innerHTML=''))}},populateAliases:e=>{const t=e.querySelectorAll(".alias");for(const e of t)switch(e.dataset.alias){case"Map":e.textContent=exports.aliases.map;break;case"Lot":e.textContent=exports.aliases.lot;break;case"lot":e.textContent=exports.aliases.lot.toLowerCase();break;case"Occupancy":e.textContent=exports.aliases.occupancy;break;case"occupancy":e.textContent=exports.aliases.occupancy.toLowerCase();break;case"Occupant":e.textContent=exports.aliases.occupant;break;case"occupant":e.textContent=exports.aliases.occupant.toLowerCase();break;case"ExternalReceiptNumber":e.textContent=exports.aliases.externalReceiptNumber}},getRandomColor:e=>{let t=e;return t.length<2&&(t+="a1"),exports.randomColor({seed:t+t,hue:a[t.codePointAt(t.length-1)%a.length],luminosity:s[t.codePointAt(t.length-2)%s.length]})}};exports.los=l})(); \ No newline at end of file +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=e=>{const t=e.currentTarget.closest(".field").querySelector("input, select");if(t.classList.remove("is-readonly"),"INPUT"===t.tagName)t.readOnly=!1,t.disabled=!1;else{const e=t.querySelectorAll("option");for(const t of e)t.disabled=!1}t.focus()},t={type:"date",dateFormat:"yyyy-MM-dd",showFooter:!1,color:"info",displayMode:"dialog"},o={type:"time",timeFormat:"hh:mm",color:"info",displayMode:"dialog",validateLabel:"Set Time",minuteSteps:1},a=["red","green","orange","blue","pink","yellow","purple"],s=["bright","light","dark"],l={highlightMap:(e,t,o)=>{let a,s=t;for(;!(a=e.querySelector("#"+s))&&s.includes("-");)s=s.slice(0,Math.max(0,s.lastIndexOf("-")));if(a){a.style.fill=null,a.classList.add("highlight","is-"+o);const e=a.querySelectorAll("path");for(const t of e)t.style.fill=null}},initializeUnlockFieldButtons:t=>{const o=t.querySelectorAll(".is-unlock-field-button");for(const t of o)t.addEventListener("click",e)},initializeDatePickers:e=>{const o=e.querySelectorAll("input[type='date']");for(const a of o){const o=Object.assign({},t);a.required&&(o.showClearButton=!1),a.min&&(o.minDate=cityssm.dateStringToDate(a.min)),a.max&&(o.maxDate=cityssm.dateStringToDate(a.max));const s=exports.bulmaCalendar.attach(a,o)[0];s.on("save",()=>{a.value=s.value(),a.dispatchEvent(new Event("change"))}),s.on("show",()=>{document.querySelector("html").classList.add("is-clipped")}),s.on("hide",()=>{bulmaJS.toggleHtmlClipped()});const l=e.querySelector("#"+s._id),r=l.querySelectorAll(".datepicker-nav button.is-text");for(const e of r)e.classList.add("is-"+t.color),e.classList.remove("is-text");const n=l.querySelector(".datetimepicker-clear-button");n&&(a.required?n.remove():(n.dataset.tooltip="Clear",n.ariaLabel="Clear",n.innerHTML=''));const i=document.querySelector("label[for='"+a.id+"']");i&&(l.querySelector(".datetimepicker-dummy-input").ariaLabel=i.textContent)}},initializeTimePickers:e=>{const t=e.querySelectorAll("input[type='time']");for(const a of t){const t=Object.assign({},o);a.required&&(t.showClearButton=!1);const s=exports.bulmaCalendar.attach(a,t)[0];s.on("save",()=>{a.value=s.value(),a.dispatchEvent(new Event("change"))}),s.on("show",()=>{document.querySelector("html").classList.add("is-clipped")}),s.on("hide",()=>{bulmaJS.toggleHtmlClipped()});const l=e.querySelector("#"+s._id),r=l.querySelector(".datetimepicker-footer-cancel");r&&r.remove();const n=l.querySelector(".datetimepicker-clear-button");n&&(a.required?n.remove():(n.dataset.tooltip="Clear",n.innerHTML=''))}},populateAliases:e=>{const t=e.querySelectorAll(".alias");for(const e of t)switch(e.dataset.alias){case"Map":e.textContent=exports.aliases.map;break;case"Lot":e.textContent=exports.aliases.lot;break;case"lot":e.textContent=exports.aliases.lot.toLowerCase();break;case"Occupancy":e.textContent=exports.aliases.occupancy;break;case"occupancy":e.textContent=exports.aliases.occupancy.toLowerCase();break;case"Occupant":e.textContent=exports.aliases.occupant;break;case"occupant":e.textContent=exports.aliases.occupant.toLowerCase();break;case"ExternalReceiptNumber":e.textContent=exports.aliases.externalReceiptNumber}},getRandomColor:e=>{let t=e;return t.length<2&&(t+="a1"),exports.randomColor({seed:t+t,hue:a[t.codePointAt(t.length-1)%a.length],luminosity:s[t.codePointAt(t.length-2)%s.length]})}};exports.los=l})(); \ No newline at end of file