
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@etchteam/storybook-addon-a11y-interaction-tests
Advanced tools
Storybook addon for accessibility interaction tests
A collection of reusable accessibility interaction tests for common UI patterns that can be used in Storybook's test runner play functions.
npm install --save-dev @etchteam/storybook-addon-a11y-interaction-tests
# or
yarn add -D @etchteam/storybook-addon-a11y-interaction-tests
This addon provides a set of reusable accessibility interaction tests that you can use in your Storybook stories' play functions. The tests follow the W3C ARIA Design Patterns and test for proper ARIA roles, states, properties, and keyboard interactions.
import type { Meta, StoryObj } from '@storybook/react';
import { expect, userEvent } from '../utils/test-utils';
import { a11yButton } from '@etchteam/storybook-addon-a11y-interaction-tests';
import { Button } from './Button';
const meta: Meta<typeof Button> = {
component: Button,
argTypes: {
// ... your argTypes
},
};
export default meta;
type Story = StoryObj<typeof Button>;
export const Primary: Story = {
args: {
label: 'Button',
primary: true,
},
play: async ({ canvasElement, step }) => {
// Run the a11y button tests
await a11yButton({
step,
canvasElement,
isDisabled: false,
isToggle: false,
});
// Add any additional tests specific to your button component
},
};
export const Disabled: Story = {
args: {
label: 'Disabled Button',
disabled: true,
},
play: async ({ canvasElement, step }) => {
await a11yButton({
step,
canvasElement,
isDisabled: true,
});
},
};
You can use multiple accessibility tests for components that combine patterns:
import { a11yButton, a11yDisclosure } from '@etchteam/storybook-addon-a11y-interaction-tests';
// ...
export const DisclosureButton: Story = {
args: {
// ...
},
play: async ({ canvasElement, step }) => {
// Test both button and disclosure aspects
await a11yButton({ step, canvasElement });
await a11yDisclosure({ step, canvasElement });
},
};
This addon includes tests for the following ARIA patterns:
a11yAccordion
- Tests for accordion componentsa11yAlert
- Tests for alert componentsa11yAlertDialog
- Tests for alert dialog componentsa11yButton
- Tests for button componentsa11yCarousel
- Tests for carousel componentsa11yCheckbox
- Tests for checkbox componentsa11yCombobox
- Tests for combobox componentsa11yDisclosure
- Tests for disclosure componentsa11yLink
- Tests for link componentsa11yModal
- Tests for modal dialog componentsa11yRadio
- Tests for radio button componentsa11ySwitch
- Tests for switch componentsa11yTable
- Tests for table componentsa11yTabs
- Tests for tabs componentsEach test function accepts parameters specific to that component type.
MIT
FAQs
Storybook addon for accessibility interaction tests
We found that @etchteam/storybook-addon-a11y-interaction-tests demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.