Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JunTaoLuo committed Feb 1, 2025
1 parent 4073cb4 commit e60aa34
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/applications/vaos/components/AppointmentColumn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default function AppointmentColumn({
<div
className={getClasses({ className, first, padding, last, size })}
style={{ ...defaultStyles.canceled, ...style }}
data-testid="cell"
{...props}
>
{children}
Expand Down
10 changes: 5 additions & 5 deletions src/applications/vaos/components/AppointmentColumn.unit.spec.js
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
1 change: 1 addition & 0 deletions src/applications/vaos/components/AppointmentRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default function AppointmentRow({
id={id}
className={`vads-u-display--flex vads-u-flex-direction--column ${className}`}
style={{ ...style }}
data-testid="row"
{...props}
>
{children}
Expand Down
8 changes: 4 additions & 4 deletions src/applications/vaos/components/AppointmentRow.unit.spec.js
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
60 changes: 60 additions & 0 deletions src/applications/vaos/services/mocks/v2/clinics.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,66 @@
"patientDisplay": null,
"char4": null
}
},
{
"id": "455",
"type": "clinics",
"attributes": {
"vistaSite": 983,
"id": "455",
"serviceName": "CHY PC CASSIDY",
"physicalLocation": "CASSIDY PAVILION",
"phoneNumber": null,
"stationId": "983",
"stationName": "CHYSHR-Cheyenne VA Medical Center",
"primaryStopCode": 323,
"primaryStopCodeName": "PRIMARY CARE/MEDICINE",
"secondaryStopCode": null,
"secondaryStopCodeName": "*Missing*",
"patientDirectScheduling": true,
"patientDisplay": null,
"char4": null
}
},
{
"id": "457",
"type": "clinics",
"attributes": {
"vistaSite": 983,
"id": "457",
"serviceName": "Green Team Clinic2",
"physicalLocation": "Green Tower, 2nd Floor",
"phoneNumber": null,
"stationId": "983",
"stationName": "CHYSHR-Cheyenne VA Medical Center",
"primaryStopCode": 323,
"primaryStopCodeName": "PRIMARY CARE/MEDICINE",
"secondaryStopCode": 117,
"secondaryStopCodeName": "NURSING (2ND ONLY)",
"patientDirectScheduling": true,
"patientDisplay": null,
"char4": null
}
},
{
"id": "848",
"type": "clinics",
"attributes": {
"vistaSite": 983,
"id": "848",
"serviceName": "CHY PC VAR2",
"physicalLocation": "ARROWHEAD WING, Suite A",
"phoneNumber": null,
"stationId": "983",
"stationName": "CHYSHR-Cheyenne VA Medical Center",
"primaryStopCode": 323,
"primaryStopCodeName": "PRIMARY CARE/MEDICINE",
"secondaryStopCode": null,
"secondaryStopCodeName": "*Missing*",
"patientDirectScheduling": true,
"patientDisplay": null,
"char4": null
}
}
]
}

0 comments on commit e60aa34

Please sign in to comment.