-
Notifications
You must be signed in to change notification settings - Fork 123
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
[MHV-61146] sets focus on error field after clicking send btn #31543
Draft
vsaleem
wants to merge
54
commits into
main
Choose a base branch
from
61146-Resolve-focus-on-validation-errs-sm
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
da13cf0
[MHV-61146] sets focus on error field after clicking send btn
vsaleem b870566
uncomment failed tests
fazilqa 9368710
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem e38da14
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem b9020c1
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem d9383ae
update verifyFocusOnErrorMessage
fazilqa b796b4a
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem a86a9e7
[MHV-61146] Resolve recipient select bug, user is not allowed to send…
vsaleem 1ba0d15
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem 9be8af8
[MHV-61146] Bug fix, prevents user from saving or sending a message …
vsaleem 9270afa
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem c21b07f
add test to compose-errors spec
fazilqa 39704e6
Merge remote-tracking branch 'origin/61146-Resolve-focus-on-validatio…
fazilqa f785e06
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
fazilqa 205e5bf
[MHV-61146] Accessibility fix to adjust focus to announce the recipie…
vsaleem 695d1f4
[MHV-61146] Unit test fixes in progress
vsaleem 3b427a7
test fix
fazilqa dc3c4f7
[MHV-61146] unit test updates for electronic signature checkbox
vsaleem a6cc584
cleanup
vsaleem 48ce670
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem 741ca2f
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem 56e7e6f
cleanup
vsaleem ace4e23
fix failed tests
fazilqa daaa373
code cleanup
fazilqa f1a6792
update test
fazilqa 19cf3ff
cleanup
vsaleem 272deeb
[MHV-61146] cleanup; Removed separate signature and checkbox validati…
vsaleem 183626e
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem f19a1a9
[MHV-61146] Resolve bug; focus remains on recipient after selection a…
vsaleem 2d180a9
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem e2e6719
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem 8fbf8ce
[MHV-61146] Remove aria-live polite from alert to prevent announcing …
vsaleem f66f488
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem 2b7aa8a
update method according to correct behavior
fazilqa 4b5cfe7
[MHV-61146] Bug fix, user can save draft with attachment modal
vsaleem 82aefb7
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem c47aa28
[MHV-61146] Cleanup unit tests and ElectronicSignature fields must be…
vsaleem 4c90da2
[MHV-61146] cleanup
vsaleem 886837e
cleanup
vsaleem 3c9a31c
update focus assertion
fazilqa 4307e74
update constants
fazilqa 273345a
Merge remote-tracking branch 'origin/61146-Resolve-focus-on-validatio…
fazilqa 64589e7
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem 19c4ab6
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem 8c86d74
checking for interpolation errors
vsaleem 08dc628
[MHV-61146] Adding cy test updates
vsaleem d30e51d
Merge branch 'main' into 61146-Resolve-validation-focus-3rd-branch
vsaleem 192208a
Merge branch 'main' into 61146-Resolve-validation-focus-3rd-branch
vsaleem 379ee65
[MHV-61146] Fix validation focus on Reply page
vsaleem 7e16866
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem c49bf05
Merge branch '61146-Resolve-validation-focus-3rd-branch' into 61146-R…
vsaleem ad69100
Update secure-messaging-keyboard-nav-save-draft.cypress.spec.js
vsaleem 01dda73
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem ae53f51
Merge branch 'main' into 61146-Resolve-focus-on-validation-errs-sm
vsaleem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
182 changes: 88 additions & 94 deletions
182
src/applications/mhv-secure-messaging/components/ComposeForm/ComposeForm.jsx
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,31 +57,38 @@ describe('RecipientsSelect', () => { | |
const onValueChange = sinon.spy(); | ||
const setCheckboxMarked = sinon.spy(); | ||
const setElectronicSignature = sinon.spy(); | ||
const setAlertDisplayed = sinon.spy(); | ||
const customProps = { | ||
onValueChange, | ||
setCheckboxMarked, | ||
setElectronicSignature, | ||
setAlertDisplayed, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you mean to add validation for this spy? |
||
}; | ||
const screen = setup({ props: customProps }); | ||
const val = recipientsList[0].id; | ||
selectVaSelect(screen.container, val); | ||
const select = screen.getByTestId('compose-recipient-select'); | ||
|
||
waitFor(() => { | ||
expect(setAlertDisplayed).to.be.calledOnce; | ||
expect(select).to.have.value(val); | ||
expect(onValueChange.calledOnce).to.be.true; | ||
expect(onValueChange.calledWith(recipientsList[0])).to.be.true; | ||
}); | ||
expect(onValueChange.calledWith(recipientsList[0])).to.be.true; | ||
}); | ||
|
||
it('displays the signature alert when a recipient with signatureRequired is selected', async () => { | ||
const setAlertDisplayed = sinon.spy(); | ||
const customProps = { | ||
isSignatureRequired: true, | ||
setAlertDisplayed, | ||
alertDisplayed: true, | ||
}; | ||
const { getByTestId } = setup({ props: customProps }); | ||
|
||
waitFor(() => { | ||
const alert = getByTestId('signature-alert'); | ||
expect(setAlertDisplayed).to.be.calledOnce; | ||
expect(alert).to.exist; | ||
expect(alert).to.contain.text( | ||
Constants.Prompts.Compose.SIGNATURE_REQUIRED, | ||
|
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious why do we need to set this to a blank object
{}
if normal values are strings? should it benull
or' '
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having
null
or an' '
here caused a small bug that would not focus on the select field when the value was deselected. We need the blank{}
here becauseselectedRecipient
andrecipient
are returning objects when selected. Ife.detail.value
has an empty value,' '
, then theselectedRecipient
should be an empty{}
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
understood. As as we tested during code pairing, we did ensure that selectedRecipient is populated with an object, so that makes sense