admin accessibility testing

deepsource-autofix-76c6eb20
Dan Gowans 2022-10-28 09:59:07 -04:00
parent 4817d40c94
commit b0f113ba92
17 changed files with 172 additions and 32 deletions

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1,20 @@
import { testAdmin } from "../../../test/_globals.js";
import { logout, login } from "../../support/index.js";
describe("Admin - Config Table Management", () => {
before(() => {
logout();
login(testAdmin);
});
after(logout);
beforeEach("Loads page", () => {
cy.visit("/admin/tables");
cy.location("pathname").should("equal", "/admin/tables");
});
it("Has no detectable accessibility issues", () => {
cy.get(".tabs a").each(($tab) => {
cy.wrap($tab).click({ force: true });
cy.injectAxe();
cy.checkA11y();
});
});
});

View File

@ -0,0 +1,27 @@
/* eslint-disable unicorn/filename-case, promise/catch-or-return, promise/always-return */
import { testAdmin } from "../../../test/_globals.js";
import { logout, login } from "../../support/index.js";
describe("Admin - Config Table Management", () => {
before(() => {
logout();
login(testAdmin);
});
after(logout);
beforeEach("Loads page", () => {
cy.visit("/admin/tables");
cy.location("pathname").should("equal", "/admin/tables");
});
it("Has no detectable accessibility issues", () => {
cy.get(".tabs a").each(($tab) => {
cy.wrap($tab).click({ force: true });
cy.injectAxe();
cy.checkA11y();
});
});
});

View File

@ -27,7 +27,7 @@ describe("Admin - Fee Management", () => {
cy.get(".container--feeCategory .panel-heading .title").should("contain.text", fee.feeCategory); cy.get(".container--feeCategory .panel-heading .title").should("contain.text", fee.feeCategory);
}); });
}); });
it.only("Creates a new fee", () => { it("Creates a new fee", () => {
cy.get("[data-cy='addFee']").first().click(); cy.get("[data-cy='addFee']").first().click();
cy.get(".modal").should("be.visible"); cy.get(".modal").should("be.visible");
cy.injectAxe(); cy.injectAxe();

View File

@ -48,7 +48,7 @@ describe("Admin - Fee Management", () => {
}); });
}); });
it.only("Creates a new fee", () => { it("Creates a new fee", () => {
cy.get("[data-cy='addFee']").first().click(); cy.get("[data-cy='addFee']").first().click();
cy.get(".modal").should("be.visible"); cy.get(".modal").should("be.visible");

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1,17 @@
import { testAdmin } from "../../../test/_globals.js";
import { logout, login } from "../../support/index.js";
describe("Admin - Lot Type Management", () => {
before(() => {
logout();
login(testAdmin);
});
after(logout);
beforeEach("Loads page", () => {
cy.visit("/admin/lotTypes");
cy.location("pathname").should("equal", "/admin/lotTypes");
});
it("Has no detectable accessibility issues", () => {
cy.injectAxe();
cy.checkA11y();
});
});

View File

@ -0,0 +1,24 @@
/* eslint-disable unicorn/filename-case, promise/catch-or-return, promise/always-return */
import { testAdmin } from "../../../test/_globals.js";
import { logout, login } from "../../support/index.js";
describe("Admin - Lot Type Management", () => {
before(() => {
logout();
login(testAdmin);
});
after(logout);
beforeEach("Loads page", () => {
cy.visit("/admin/lotTypes");
cy.location("pathname").should("equal", "/admin/lotTypes");
});
it("Has no detectable accessibility issues", () => {
cy.injectAxe();
cy.checkA11y();
});
});

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1,17 @@
import { testAdmin } from "../../../test/_globals.js";
import { logout, login } from "../../support/index.js";
describe("Admin - Occupancy Type Management", () => {
before(() => {
logout();
login(testAdmin);
});
after(logout);
beforeEach("Loads page", () => {
cy.visit("/admin/occupancyTypes");
cy.location("pathname").should("equal", "/admin/occupancyTypes");
});
it("Has no detectable accessibility issues", () => {
cy.injectAxe();
cy.checkA11y();
});
});

View File

@ -0,0 +1,24 @@
/* eslint-disable unicorn/filename-case, promise/catch-or-return, promise/always-return */
import { testAdmin } from "../../../test/_globals.js";
import { logout, login } from "../../support/index.js";
describe("Admin - Occupancy Type Management", () => {
before(() => {
logout();
login(testAdmin);
});
after(logout);
beforeEach("Loads page", () => {
cy.visit("/admin/occupancyTypes");
cy.location("pathname").should("equal", "/admin/occupancyTypes");
});
it("Has no detectable accessibility issues", () => {
cy.injectAxe();
cy.checkA11y();
});
});

View File

@ -131,10 +131,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
'<div class="control">' + '<div class="control">' +
'<input class="input" name="workOrderType" type="text" value="' + '<input class="input" name="workOrderType" type="text" value="' +
cityssm.escapeHTML(workOrderType.workOrderType) + cityssm.escapeHTML(workOrderType.workOrderType) +
'" maxlength="100" required />' + '" maxlength="100" aria-label="Work Order Type" required />' +
"</div>" + "</div>" +
'<div class="control">' + '<div class="control">' +
'<button class="button is-success" type="submit"><i class="fas fa-save" aria-hidden="true"></i></button>' + '<button class="button is-success" type="submit" aria-label="Save"><i class="fas fa-save" aria-hidden="true"></i></button>' +
"</div>" + "</div>" +
"</div>") + "</div>") +
"</form>" + "</form>" +
@ -323,10 +323,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
'<div class="control">' + '<div class="control">' +
'<input class="input" name="workOrderMilestoneType" type="text" value="' + '<input class="input" name="workOrderMilestoneType" type="text" value="' +
cityssm.escapeHTML(workOrderMilestoneType.workOrderMilestoneType) + cityssm.escapeHTML(workOrderMilestoneType.workOrderMilestoneType) +
'" maxlength="100" required />' + '" maxlength="100" aria-label="Work Order Milestone Type" required />' +
"</div>" + "</div>" +
'<div class="control">' + '<div class="control">' +
'<button class="button is-success" type="submit"><i class="fas fa-save" aria-hidden="true"></i></button>' + '<button class="button is-success" type="submit" aria-label="Save"><i class="fas fa-save" aria-hidden="true"></i></button>' +
"</div>" + "</div>" +
"</div>") + "</div>") +
"</form>" + "</form>" +
@ -518,12 +518,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
'" />' + '" />' +
('<div class="field has-addons">' + ('<div class="field has-addons">' +
'<div class="control">' + '<div class="control">' +
'<input class="input" name="lotStatus" type="text" value="' + '<input class="input" name="lotStatus" type="text"' +
cityssm.escapeHTML(lotStatus.lotStatus) + (' value="' + cityssm.escapeHTML(lotStatus.lotStatus) + '"') +
'" maxlength="100" required />' + (' aria-label="' + cityssm.escapeHTML(exports.aliases.lot) + ' Status"') +
' maxlength="100" required />' +
"</div>" + "</div>" +
'<div class="control">' + '<div class="control">' +
'<button class="button is-success" type="submit"><i class="fas fa-save" aria-hidden="true"></i></button>' + '<button class="button is-success" type="submit" aria-label="Save"><i class="fas fa-save" aria-hidden="true"></i></button>' +
"</div>" + "</div>" +
"</div>") + "</div>") +
"</form>" + "</form>" +
@ -744,12 +745,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
'" />' + '" />' +
('<div class="field has-addons">' + ('<div class="field has-addons">' +
'<div class="control">' + '<div class="control">' +
'<input class="input" name="lotOccupantType" type="text" value="' + '<input class="input" name="lotOccupantType" type="text"' +
cityssm.escapeHTML(lotOccupantType.lotOccupantType) + (' value="' + cityssm.escapeHTML(lotOccupantType.lotOccupantType) + '"') +
'" maxlength="100" required />' + (' aria-label="' +
cityssm.escapeHTML(exports.aliases.lot + " " + exports.aliases.occupant) +
' Type"') +
' maxlength="100" required />' +
"</div>" + "</div>" +
'<div class="control">' + '<div class="control">' +
'<button class="button is-success" type="submit"><i class="fas fa-save" aria-hidden="true"></i></button>' + '<button class="button is-success" type="submit" aria-label="Save"><i class="fas fa-save" aria-hidden="true"></i></button>' +
"</div>" + "</div>" +
"</div>") + "</div>") +
"</form>" + "</form>" +

View File

@ -197,10 +197,10 @@ declare const bulmaJS: BulmaJS;
'<div class="control">' + '<div class="control">' +
'<input class="input" name="workOrderType" type="text" value="' + '<input class="input" name="workOrderType" type="text" value="' +
cityssm.escapeHTML(workOrderType.workOrderType) + cityssm.escapeHTML(workOrderType.workOrderType) +
'" maxlength="100" required />' + '" maxlength="100" aria-label="Work Order Type" required />' +
"</div>" + "</div>" +
'<div class="control">' + '<div class="control">' +
'<button class="button is-success" type="submit"><i class="fas fa-save" aria-hidden="true"></i></button>' + '<button class="button is-success" type="submit" aria-label="Save"><i class="fas fa-save" aria-hidden="true"></i></button>' +
"</div>" + "</div>" +
"</div>") + "</div>") +
"</form>" + "</form>" +
@ -460,10 +460,10 @@ declare const bulmaJS: BulmaJS;
'<div class="control">' + '<div class="control">' +
'<input class="input" name="workOrderMilestoneType" type="text" value="' + '<input class="input" name="workOrderMilestoneType" type="text" value="' +
cityssm.escapeHTML(workOrderMilestoneType.workOrderMilestoneType) + cityssm.escapeHTML(workOrderMilestoneType.workOrderMilestoneType) +
'" maxlength="100" required />' + '" maxlength="100" aria-label="Work Order Milestone Type" required />' +
"</div>" + "</div>" +
'<div class="control">' + '<div class="control">' +
'<button class="button is-success" type="submit"><i class="fas fa-save" aria-hidden="true"></i></button>' + '<button class="button is-success" type="submit" aria-label="Save"><i class="fas fa-save" aria-hidden="true"></i></button>' +
"</div>" + "</div>" +
"</div>") + "</div>") +
"</form>" + "</form>" +
@ -725,12 +725,13 @@ declare const bulmaJS: BulmaJS;
'" />' + '" />' +
('<div class="field has-addons">' + ('<div class="field has-addons">' +
'<div class="control">' + '<div class="control">' +
'<input class="input" name="lotStatus" type="text" value="' + '<input class="input" name="lotStatus" type="text"' +
cityssm.escapeHTML(lotStatus.lotStatus) + (' value="' + cityssm.escapeHTML(lotStatus.lotStatus) + '"') +
'" maxlength="100" required />' + (' aria-label="' + cityssm.escapeHTML(exports.aliases.lot) + ' Status"') +
' maxlength="100" required />' +
"</div>" + "</div>" +
'<div class="control">' + '<div class="control">' +
'<button class="button is-success" type="submit"><i class="fas fa-save" aria-hidden="true"></i></button>' + '<button class="button is-success" type="submit" aria-label="Save"><i class="fas fa-save" aria-hidden="true"></i></button>' +
"</div>" + "</div>" +
"</div>") + "</div>") +
"</form>" + "</form>" +
@ -1028,12 +1029,15 @@ declare const bulmaJS: BulmaJS;
'" />' + '" />' +
('<div class="field has-addons">' + ('<div class="field has-addons">' +
'<div class="control">' + '<div class="control">' +
'<input class="input" name="lotOccupantType" type="text" value="' + '<input class="input" name="lotOccupantType" type="text"' +
cityssm.escapeHTML(lotOccupantType.lotOccupantType) + (' value="' + cityssm.escapeHTML(lotOccupantType.lotOccupantType) + '"') +
'" maxlength="100" required />' + (' aria-label="' +
cityssm.escapeHTML(exports.aliases.lot + " " + exports.aliases.occupant) +
' Type"') +
' maxlength="100" required />' +
"</div>" + "</div>" +
'<div class="control">' + '<div class="control">' +
'<button class="button is-success" type="submit"><i class="fas fa-save" aria-hidden="true"></i></button>' + '<button class="button is-success" type="submit" aria-label="Save"><i class="fas fa-save" aria-hidden="true"></i></button>' +
"</div>" + "</div>" +
"</div>") + "</div>") +
"</form>" + "</form>" +

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
import * as assert from "assert"; import * as assert from "assert";
import { portNumber } from "./_globals.js"; import { portNumber } from "./_globals.js";
import { exec } from "child_process"; import { exec } from "node:child_process";
import * as http from "http"; import * as http from "node:http";
import { app } from "../app.js"; import { app } from "../app.js";
describe("lot-occupancy-system", () => { describe("lot-occupancy-system", () => {
const httpServer = http.createServer(app); const httpServer = http.createServer(app);

View File

@ -4,9 +4,9 @@ import * as assert from "assert";
import { portNumber } from "./_globals.js"; import { portNumber } from "./_globals.js";
import { exec } from "child_process"; import { exec } from "node:child_process";
import * as http from "http"; import * as http from "node:http";
import { app } from "../app.js"; import { app } from "../app.js";
describe("lot-occupancy-system", () => { describe("lot-occupancy-system", () => {

View File

@ -28,7 +28,7 @@
</h1> </h1>
<div class="tabs is-boxed"> <div class="tabs is-boxed">
<ul> <ul role="presentation">
<li class="is-active"> <li class="is-active">
<a href="#tab--workOrderTypes"> <a href="#tab--workOrderTypes">
<span class="icon is-small"><i class="fas fa-table" aria-hidden="true"></i></span> <span class="icon is-small"><i class="fas fa-table" aria-hidden="true"></i></span>