Skip to content

Commit

Permalink
Add test-axe script for desktop (#2798)
Browse files Browse the repository at this point in the history
* Add test-axe script to run axe unit tests for desktop

* Update test scripts
  • Loading branch information
cRui861 committed Sep 12, 2023
1 parent df863d9 commit c919b6c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"clean": "rimraf build/* dll/* python/dist/* python/build/* src/generated/*",
"karma": "cross-env NODE_OPTIONS=--openssl-legacy-provider node --max_old_space_size=4096 node_modules/karma/bin/karma",
"test": "npm run test-client:coverage && npm run test-app",
"test:all": "cross-env BE_ENABLE_A11Y_TESTING=true npm run test-client:coverage && npm run test-app",
"test-app:a11y": "cross-env BE_ENABLE_A11Y_TESTING=true npm run test-app",
"test-app": "cross-env COVERAGE=1 npm run karma -- start",
"test-app:mem": "cross-env DEBUG_MEM=1 npm run test-app",
"test-app-watch": "npm run karma -- start --auto-watch --no-single-run",
Expand Down Expand Up @@ -83,7 +85,7 @@
"workspace:start:desktop": "npm run dev-server",
"workspace:test": "npm run test",
"workspace:test:desktop": "npm run test",
"workspace:test:all": "npm run test"
"workspace:test:all": "npm run test:all"
},
"license": "MIT",
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ActivityMonitorItemComponent } from "./activity-monitor-item";
import { ActivityMonitorItemActionComponent } from "./activity-monitor-item/activity-monitor-item-action";
import { ActivityMonitorTreeViewComponent } from "./activity-monitor-tree-view";
import { ActivityMonitorComponent } from "./activity-monitor.component";
import { runAxe } from "test/utils/helpers/axe-helpers";

describe("ActivityMonitorComponent", () => {
let fixture: ComponentFixture<ActivityMonitorComponent>;
Expand Down Expand Up @@ -87,4 +88,8 @@ describe("ActivityMonitorComponent", () => {

expect(component.runningActivities.length).toBe(0);
});

it("should pass accessibility test activity monitor", async () => {
expect(await runAxe(fixture.nativeElement)).toHaveNoViolations();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import * as TestConstants from "test/test-constants";
import { validateControl } from "test/utils/helpers";
import { ServerErrorMockComponent, complexFormMockComponents } from "test/utils/mocks/components";
import { BatchAccountCreateComponent } from "./batch-account-create.component";
import { runAxe } from "test/utils/helpers/axe-helpers";

describe("BatchAccountCreateComponent ", () => {
let fixture: ComponentFixture<BatchAccountCreateComponent>;
Expand Down Expand Up @@ -187,6 +188,10 @@ describe("BatchAccountCreateComponent ", () => {
expect(debugElement.nativeElement.textContent).toContain("Create batch account");
});

it("should pass accessibility test batch account create", async () => {
expect(await runAxe(fixture.nativeElement)).toHaveNoViolations();
});

describe("Batch account name", () => {
it("should initialize name control", () => {
const input = debugElement.query(By.css("input[formControlName=name]")).nativeElement;
Expand Down

0 comments on commit c919b6c

Please sign in to comment.