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

508 Appointment list refactor to reduce screenreader verbosity #34433

Merged
merged 4 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/applications/vaos/components/AppointmentColumn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export default function AppointmentColumn({
<div
className={getClasses({ className, first, padding, last, size })}
style={{ ...defaultStyles.canceled, ...style }}
data-testid="cell"
{...props}
role="cell"
>
{children}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('VAOS Component: AppointmentColumn', () => {
// Arrange
// Act
const screen = render(<AppointmentColumn />);
const column = screen.getByRole('cell');
const column = screen.queryByTestId('cell');

// Assert
expect(column.classList.contains('vads-u-flex--1'));
Expand All @@ -41,7 +41,7 @@ describe('VAOS Component: AppointmentColumn', () => {
// Arrange
// Act
const screen = render(<AppointmentColumn canceled />);
const column = screen.getByRole('cell');
const column = screen.queryByTestId('cell');

// Assert
expect(assertTextDecoration(column, 'text-decoration', 'line-through'));
Expand All @@ -55,7 +55,7 @@ describe('VAOS Component: AppointmentColumn', () => {
<p>This is a test</p>
</AppointmentColumn>,
);
const column = screen.getByRole('cell');
const column = screen.queryByTestId('cell');

// Assert
expect(column.childElementCount).to.equal(1);
Expand All @@ -65,7 +65,7 @@ describe('VAOS Component: AppointmentColumn', () => {
// Arrange
// Act
const screen = render(<AppointmentColumn className="class1" />);
const column = screen.getByRole('cell');
const column = screen.queryByTestId('cell');

// Assert
expect(column.classList.contains('vads-u-flex--1'));
Expand All @@ -77,7 +77,7 @@ describe('VAOS Component: AppointmentColumn', () => {
// Arrange
// Act
const screen = render(<AppointmentColumn style={{ margin: 0 }} />);
const column = screen.getByRole('cell');
const column = screen.queryByTestId('cell');

// Assert
expect(assertTextDecoration(column, 'margin', '0px'));
Expand Down
20 changes: 8 additions & 12 deletions src/applications/vaos/components/AppointmentRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ export default function AppointmentRow({
...props
}) {
return (
<div role="grid">
<div role="rowgroup">
<div
id={id}
className={`vads-u-display--flex vads-u-flex-direction--column ${className}`}
style={{ ...style }}
{...props}
role="row"
>
{children}
</div>
</div>
<div
id={id}
className={`vads-u-display--flex vads-u-flex-direction--column ${className}`}
style={{ ...style }}
data-testid="row"
{...props}
>
{children}
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('VAOS Component: AppointmentRow', () => {
// Arrange
// Act
const screen = render(<AppointmentRow />);
const row = screen.getByRole('row');
const row = screen.queryByTestId('row');

// Assert
expect(row.classList.contains('vads-u-display--flex'));
Expand All @@ -43,7 +43,7 @@ describe('VAOS Component: AppointmentRow', () => {
<p>This is a test</p>
</AppointmentRow>,
);
const row = screen.getByRole('row');
const row = screen.queryByTestId('row');

// Assert
expect(row.childElementCount).to.equal(1);
Expand All @@ -53,7 +53,7 @@ describe('VAOS Component: AppointmentRow', () => {
// Arrange
// Act
const screen = render(<AppointmentRow className="class1" />);
const row = screen.getByRole('row');
const row = screen.queryByTestId('row');

// Assert
expect(row.classList.contains('vads-u-display--flex'));
Expand All @@ -65,7 +65,7 @@ describe('VAOS Component: AppointmentRow', () => {
// Arrange
// Act
const screen = render(<AppointmentRow style={{ margin: 0 }} />);
const row = screen.getByRole('row');
const row = screen.queryByTestId('row');

// Assert
expect(assertTextDecoration(row, 'margin', '0px'));
Expand Down
Loading