-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
124 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/applications/vaos/referral-appointments/components/ErrorAlert.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
|
||
const ErrorAlert = () => { | ||
return ( | ||
<va-alert data-testid="error" status="error"> | ||
<h2>We’re sorry. We’ve run into a problem.</h2> | ||
<p> | ||
Something went wrong on our end. Please refresh the page and try again. | ||
</p> | ||
</va-alert> | ||
); | ||
}; | ||
|
||
export default ErrorAlert; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/applications/vaos/referral-appointments/components/ReferralLayout.unit.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React from 'react'; | ||
import { expect } from 'chai'; | ||
import ReferralLayout from './ReferralLayout'; | ||
import { | ||
renderWithStoreAndRouter, | ||
createTestStore, | ||
} from '../../tests/mocks/setup'; | ||
|
||
describe('VAOS Component: ReferralLayout', () => { | ||
const initialFullState = { | ||
featureToggles: { | ||
vaOnlineSchedulingCCDirectScheduling: true, | ||
}, | ||
}; | ||
it('should render the layout with the correct header and children', () => { | ||
const screen = renderWithStoreAndRouter( | ||
<ReferralLayout | ||
hasEyebrow | ||
apiFailure={false} | ||
heading="A tribute to the best heading in the world" | ||
> | ||
<div data-testid="child">I'm a child</div> | ||
</ReferralLayout>, | ||
{ | ||
store: createTestStore(initialFullState), | ||
}, | ||
); | ||
|
||
expect(screen.getByTestId('child')).to.exist; | ||
expect(screen.getByText('A tribute to the best heading in the world')).to | ||
.exist; | ||
expect(screen.getByText('New Appointment')).to.exist; | ||
}); | ||
it('should render the error with the correct header and children', () => { | ||
const screen = renderWithStoreAndRouter( | ||
<ReferralLayout | ||
hasEyebrow | ||
apiFailure | ||
heading="A tribute to the best heading in the world" | ||
> | ||
<div data-testid="child">I'm a child</div> | ||
</ReferralLayout>, | ||
{ | ||
store: createTestStore(initialFullState), | ||
}, | ||
); | ||
|
||
expect(screen.getByTestId('error')).to.exist; | ||
expect(screen.queryByTestId('child')).to.not.exist; | ||
expect(screen.getByText('A tribute to the best heading in the world')).to | ||
.exist; | ||
expect(screen.getByText('New Appointment')).to.exist; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters