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

Adding non-urgent message alert to secure messaging form #10448

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,6 @@ context('StartNewMessage', () => {
})
})

describe('on click of the collapsible view', () => {
it('should show the Reply Help panel', async () => {
when(api.get as jest.Mock)
.calledWith('/v0/messaging/health/recipients')
.mockResolvedValue(recipients)
.calledWith('/v0/messaging/health/messages/signature')
.mockResolvedValue(signature)
initializeTestInstance()
await waitFor(() => fireEvent.press(screen.getByLabelText('Only use messages for non-urgent needs')))
await waitFor(() => expect(mockNavigationSpy).toHaveBeenCalled())
})
})

describe('when the subject is general', () => {
it('should add the text (*Required) for the subject line field', async () => {
when(api.get as jest.Mock)
Expand Down Expand Up @@ -232,4 +219,18 @@ context('StartNewMessage', () => {
await waitFor(() => expect(mockNavigationSpy).toHaveBeenCalled())
})
})

describe('when displaying the form', () => {
it('should display an alert about urgent messages', async () => {
when(api.get as jest.Mock)
.calledWith('/v0/messaging/health/recipients')
.mockResolvedValue(recipients)
.calledWith('/v0/messaging/health/messages/signature')
.mockResolvedValue(signature)
initializeTestInstance()
await waitFor(() =>
expect(screen.getAllByText('Your care team may take up to 3 business days to reply.')).toBeTruthy(),
)
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
MessageAlert,
PickerItem,
TextArea,
TextView,
} from 'components'
import { SnackbarMessages } from 'components/SnackBar'
import { Events } from 'constants/analytics'
Expand Down Expand Up @@ -373,13 +374,25 @@
)
}

const navigateToReplyHelp = () => {

Check warning on line 377 in VAMobile/src/screens/HealthScreen/SecureMessaging/StartNewMessage/StartNewMessage.tsx

View workflow job for this annotation

GitHub Actions / lint

'navigateToReplyHelp' is assigned a value but never used
logAnalyticsEvent(Events.vama_sm_nonurgent())
navigateTo('ReplyHelp')
}

return (
<Box>
<Box mb={theme.dimensions.standardMarginBetween}>
<AlertWithHaptics
variant="info"
header={t('secureMessaging.startNewMessage.nonurgent.title')}
scrollViewRef={scrollViewRef}>
<TextView variant="MobileBody">
{t('secureMessaging.startNewMessage.nonurgent.careTeam')}
<TextView variant="MobileBodyBold">{t('secureMessaging.startNewMessage.nonurgent.threeDays')}</TextView>
{t('secureMessaging.startNewMessage.nonurgent.reply')}
</TextView>
</AlertWithHaptics>
</Box>
<MessageAlert
hasValidationError={formContainsError}
saveDraftAttempted={onSaveDraftClicked}
Expand All @@ -399,14 +412,6 @@
setResetErrors={setResetErrors}
setErrorList={setErrorList}
/>
<Box mt={theme.dimensions.standardMarginBetween}>
<LinkWithAnalytics
type="custom"
text={t('secureMessaging.replyHelp.onlyUseMessages')}
onPress={navigateToReplyHelp}
testID="startNewMessageOnlyUseMessagesTestID"
/>
</Box>
<Box mt={theme.dimensions.standardMarginBetween}>
<Button
label={t('secureMessaging.formMessage.send')}
Expand Down
4 changes: 4 additions & 0 deletions VAMobile/src/translations/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,10 @@
"secureMessaging.sendError.ifTheAppStill.a11y": "If the app still doesn't work, call the My Healthy Vet Help Desk. We're here Monday-Friday, 8:00 a.m.-8:00 p.m. Eastern Time.",
"secureMessaging.sendError.title": "Message failed to send",
"secureMessaging.startNewMessage": "Start new message",
"secureMessaging.startNewMessage.nonurgent.title": "Only use messages for non-urgent needs",
"secureMessaging.startNewMessage.nonurgent.careTeam": "Your care team may take up to ",
"secureMessaging.startNewMessage.nonurgent.threeDays": "3 business days",
"secureMessaging.startNewMessage.nonurgent.reply": " to reply.",
"secureMessaging.startNewMessage.attach": "Attach",
"secureMessaging.startNewMessage.attachments.title": "Attach file",
"secureMessaging.startNewMessage.bothYouAndProviderMustBeEnrolled": "We're sorry. To send a Secure Message, both you and your VA primary care provider must be enrolled in the Secure Messaging program. Please contact your primary care provider to see if they are enrolled and can enroll you in the program.",
Expand Down
Loading