Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(steps): add axe tests, correct steps aria #846

Merged
merged 11 commits into from
Mar 19, 2024
261 changes: 259 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/oruga/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"@rollup/plugin-babel": "6.0.4",
"@types/node": "^20.11.25",
"@vitejs/plugin-vue": "^5.0.4",
"@types/jest-axe": "^3.5.9",
"@vitest/coverage-istanbul": "^1.3.1",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-standard": "^8.0.1",
Expand All @@ -91,6 +92,7 @@
"eslint-plugin-vuejs-accessibility": "^2.2.1",
"happy-dom": "^13.6.2",
"npm-check-updates": "^16.14.15",
"jest-axe": "^8.0.0",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"sass": "1.71.1",
Expand All @@ -104,4 +106,4 @@
"vue-component-type-helpers": "^2.0.6",
"vue-tsc": "^2.0.6"
}
}
}
4 changes: 4 additions & 0 deletions packages/oruga/src/__tests__/vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { expect } from "vitest";
import { toHaveNoViolations } from "jest-axe";

expect.extend(toHaveNoViolations);
10 changes: 5 additions & 5 deletions packages/oruga/src/components/steps/Steps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -475,15 +475,15 @@ function itemClasses(childItem: (typeof items.value)[number]): ClassBind[] {

<template>
<div :class="rootClasses" data-oruga="steps">
<ol
:class="wrapperClasses"
:aria-orientation="vertical ? 'vertical' : 'horizontal'">
<ol :class="wrapperClasses">
<li
v-for="(childItem, index) in items"
v-show="childItem.visible"
:key="childItem.value"
:class="itemClasses(childItem)"
:aria-selected="childItem.value === activeItem.value">
:aria-current="
childItem.value === activeItem.value ? 'step' : undefined
"
:class="itemClasses(childItem)">
<span v-if="index > 0" :class="stepDividerClasses"> </span>

<component
Expand Down
Loading
Loading