Skip to content

Commit

Permalink
Bump ver component-library to 38.0.0 (#28486)
Browse files Browse the repository at this point in the history
* bump ver component-library to 38.0.0

* update MHV selectors

Signed-off-by: Micah Chiang <micahkchiang@gmail.com>

* update missed test

Signed-off-by: Micah Chiang <micahkchiang@gmail.com>

* fix test spec

* fix edu-benefits cypress test

* update preneed intercept and progress bar selector

Signed-off-by: Micah Chiang <micahkchiang@gmail.com>

* update pensions veteran certify selector

Signed-off-by: Micah Chiang <micahkchiang@gmail.com>

* temporarily remove aXe checks

Signed-off-by: Micah Chiang <micahkchiang@gmail.com>

* revert axe

Signed-off-by: Micah Chiang <micahkchiang@gmail.com>

* update mhv tests

* fix test

* fix test

* resolve divergent branches

Signed-off-by: Micah Chiang <micahkchiang@gmail.com>

* comment out flaky category test

Signed-off-by: Micah Chiang <micahkchiang@gmail.com>

* force true on veteran-certify checkbox

Signed-off-by: Micah Chiang <micahkchiang@gmail.com>

* fix more tests

Signed-off-by: Micah Chiang <micahkchiang@gmail.com>

* more mhv fixes

Signed-off-by: Micah Chiang <micahkchiang@gmail.com>

* fix test

* update focusOnError helper to look for select tag

Signed-off-by: Micah Chiang <micahkchiang@gmail.com>

---------

Signed-off-by: Micah Chiang <micahkchiang@gmail.com>
Co-authored-by: Micah Chiang <micahkchiang@gmail.com>
  • Loading branch information
it-harrison and micahchiang committed Mar 15, 2024
1 parent 540adf8 commit 7a4cb9c
Show file tree
Hide file tree
Showing 49 changed files with 225 additions and 218 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -250,7 +250,7 @@
"@babel/runtime": "^7.15.4",
"@datadog/browser-logs": "^5.8.0",
"@datadog/browser-rum": "^4.49.0",
"@department-of-veterans-affairs/component-library": "^37.2.0",
"@department-of-veterans-affairs/component-library": "^38.0.0",
"@department-of-veterans-affairs/css-library": "^0.3.0",
"@department-of-veterans-affairs/formation": "^10.1.2",
"@department-of-veterans-affairs/react-jsonschema-form": "^1.2.5",
Expand Down
Expand Up @@ -21,37 +21,42 @@ describe('functionality of discharge wizard', () => {
// questions page | fill out form
cy.get('.main .vads-c-action-link--green').click();

cy.get('va-radio[name="1_branchOfService"] va-radio-option')
.first()
cy.get('va-radio-option[name=1_branchOfService][value="army"]')
.find('label')
.click();

cy.get('select[name="2_dischargeYear"]').select('2016');
cy.get(
`va-radio-option[label="${
questionLabels['4_reason']['1']
}"] input[type="radio"]`,
).click();

cy.get(`va-radio-option[label="${questionLabels['4_reason']['1']}"]`)
.find('label')
.click();

cy.get(
`va-radio-option[label="Yes, ${
questionLabels['6_intention']['1']
}"] input[type="radio"]`,
).click();
`va-radio-option[label="Yes, ${questionLabels['6_intention']['1']}"]`,
)
.find('label')
.click();

cy.get('va-radio[name="7_courtMartial"] va-radio-option')
.first()
cy.get(
`va-radio-option[label="Yes, ${questionLabels['7_courtMartial'][
'1'
].toLowerCase()}"]`,
)
.find('label')
.click();

cy.get('va-radio[name="8_prevApplication"] va-radio-option')
.first()
cy.get('va-radio-option[name="8_prevApplication"][value="1"]')
.find('label')
.click();

cy.get('va-radio[name="9_prevApplicationYear"] va-radio-option')
.first()
cy.get('va-radio-option[name="9_prevApplicationYear"][value="1"]')
.find('label')
.click();

cy.get('va-radio[name="12_priorService"] va-radio-option')
.first()
cy.get(
`va-radio-option[label="Yes, ${questionLabels['12_priorService']['1']}"`,
)
.find('label')
.click();

// a11y check after all elements are visible
Expand Down
Expand Up @@ -84,14 +84,11 @@ describe('Feedback Tool Test', () => {
cy.get('input[type="checkbox"]').should('exist');
cy.axeCheck();

cy.get('va-checkbox')
.shadow()
.find('input')
.click();
cy.get('va-checkbox')
.shadow()
.find('input')
.click();
// checkbox to enter information manually
cy.get('label[id="option-label"]').click();

cy.get('label[id="option-label"]').click();

cy.get(
'input[name="root_educationDetails_school_view:manualSchoolEntry_name"]',
{ timeout: Timeouts.slow },
Expand Down
@@ -1,6 +1,6 @@
import SecureMessagingSite from '../sm_site/SecureMessagingSite';
import PatientInboxPage from '../pages/PatientInboxPage';
import { Assertions, AXE_CONTEXT, Locators } from '../utils/constants';
import { AXE_CONTEXT, Locators } from '../utils/constants';
import PatientMessageDraftsPage from '../pages/PatientMessageDraftsPage';
import mockMultiDraftsResponse from '../fixtures/draftsResponse/multi-draft-response.json';

Expand Down Expand Up @@ -66,11 +66,11 @@ describe('handle multiple drafts in one thread', () => {
cy.get(Locators.REPLY_FORM)
.find('h3')
.each(el => {
cy.wrap(el).should('include.text', Assertions.DRAFT);
cy.wrap(el).should('include.text', 'Draft');
});

cy.get(Locators.ALERTS.LAST_EDIT_DATE).each(el => {
cy.wrap(el).should('include.text', Assertions.EDITED);
cy.wrap(el).should('include.text', 'edited');
});
});

Expand Down
Expand Up @@ -54,7 +54,7 @@ describe('re-save multiple drafts in one thread', () => {
},
});

cy.get('#textarea').type('newText', { force: true });
cy.get('textarea').type('newText', { force: true });
draftPage.saveMultiDraftMessage(
updatedMultiDraftResponse.data[0],
updatedMultiDraftResponse.data[0].attributes.messageId,
Expand All @@ -77,7 +77,7 @@ describe('re-save multiple drafts in one thread', () => {
});

cy.get('#edit-draft-button').click({ waitForAnimations: true });
cy.get('#textarea').type('newText', { force: true });
cy.get('textarea').type('newText', { force: true });
draftPage.saveMultiDraftMessage(
updatedMultiDraftResponse.data[1],
updatedMultiDraftResponse.data[1].attributes.messageId,
Expand Down
Expand Up @@ -29,13 +29,13 @@ describe('Secure Messaging Compose Errors Keyboard Nav', () => {
},
});
composePage.verifyFocusOnErrorMessageToSelectRecipient();
composePage.selectRecipient();
composePage.selectRecipient('CAMRY_PCMM RELATIONSHIP_05092022_SLC4');
composePage.selectSideBarMenuOption('Inbox');
composePage.clickOnDeleteDraftButton();
});

it('focus on error message for empty category', () => {
composePage.selectRecipient();
composePage.selectRecipient('CAMRY_PCMM RELATIONSHIP_05092022_SLC4');
composePage.pushSendMessageWithKeyboardPress();
composePage.verifyFocusOnErrorMessageToSelectCategory();
cy.injectAxe();
Expand All @@ -52,7 +52,7 @@ describe('Secure Messaging Compose Errors Keyboard Nav', () => {
});

it('focus on error message for empty message subject', () => {
composePage.selectRecipient();
composePage.selectRecipient('CAMRY_PCMM RELATIONSHIP_05092022_SLC4');
composePage.selectCategory();
composePage.pushSendMessageWithKeyboardPress();
composePage.verifyFocusOnErrorEmptyMessageSubject();
Expand All @@ -71,7 +71,7 @@ describe('Secure Messaging Compose Errors Keyboard Nav', () => {
composePage.clickOnDeleteDraftButton();
});
it('focus on error message for empty message body', () => {
composePage.selectRecipient();
composePage.selectRecipient('CAMRY_PCMM RELATIONSHIP_05092022_SLC4');
composePage.selectCategory();
composePage.getMessageSubjectField().type('Test Subject', { force: true });
composePage.pushSendMessageWithKeyboardPress();
Expand Down
Expand Up @@ -19,7 +19,7 @@ describe('Secure Messaging Compose', () => {
},
},
});
composePage.selectRecipient();
composePage.selectRecipient('CAMRY_PCMM RELATIONSHIP_05092022_SLC4');
composePage.selectCategory();
composePage.attachMessageFromFile('test_image.jpg');
composePage.getMessageSubjectField().click();
Expand Down
Expand Up @@ -18,7 +18,7 @@ describe('Check confirmation message after save draft', () => {
composePage
.getCategory(requestBody.category)
.first()
.click();
.click({ force: true });
composePage.getMessageSubjectField().type(`${requestBody.subject}`);
composePage
.getMessageBodyField()
Expand Down
Expand Up @@ -10,7 +10,7 @@ describe('Secure Messaging Keyboard Nav To Compose', () => {
patientInboxPage.loadInboxMessages();
});
it('Keyboard Nav from Welcome Page to Compose', () => {
cy.tabToElement(Locators.LINKS.CREATE_NEW_MESSAGE);
cy.tabToElement('[data-testid="compose-message-link"]');
cy.realPress(['Enter']);
cy.injectAxe();
cy.axeCheck(AXE_CONTEXT, {
Expand Down
Expand Up @@ -15,7 +15,9 @@ describe('Secure Messaging Verify Links and Buttons Keyboard Nav', () => {
'Go to your inbox',
);

cy.tabToElement(Locators.LINKS.CREATE_NEW_MESSAGE).should('have.focus');
cy.tabToElement('[data-testid="compose-message-link"]').should(
'have.focus',
);

cy.realPress('Tab');
cy.get(Locators.ALERTS.WELCOME_MESSAGE)
Expand Down
Expand Up @@ -2,7 +2,7 @@ import mockCustomResponse from '../fixtures/custom-response.json';
import defaultMockThread from '../fixtures/thread-response.json';
import mockMessageResponse from '../fixtures/message-custom-response.json';
import mockFolders from '../fixtures/generalResponses/folders.json';
import { Locators, Alerts, Paths, Assertions } from '../utils/constants';
import { Locators, Alerts, Paths } from '../utils/constants';

class FolderManagementPage {
currentThread = defaultMockThread;
Expand Down Expand Up @@ -141,7 +141,7 @@ class FolderManagementPage {
};

folderConfirmation = () => {
return cy.get(Locators.ALERTS.ALERT_TEXT);
return cy.get('[data-testid="alert-text"]');
};

verifyDeleteSuccessMessage = () => {
Expand Down Expand Up @@ -236,9 +236,9 @@ class FolderManagementPage {
};

verifyMoveMessageSuccessConfirmationMessage = () => {
cy.get(Locators.ALERTS.ALERT_TEXT)
cy.get('[data-testid="alert-text"]')
.should('exist')
.and('contain.text', Assertions.MESSAGE_CONVERSATION_SUCCESS);
.and('contain.text', 'Message conversation was successfully moved.');
};

verifyMoveMessageSuccessConfirmationHasFocus = () => {
Expand Down
Expand Up @@ -2,7 +2,7 @@ import mockDraftMessage from '../fixtures/message-draft-response.json';
import mockMessageResponse from '../fixtures/message-response.json';
import mockThreadResponse from '../fixtures/thread-response.json';
import mockSignature from '../fixtures/signature-response.json';
import { Assertions, Locators, Paths } from '../utils/constants';
import { Locators, Paths } from '../utils/constants';
import mockDraftResponse from '../fixtures/message-compose-draft-response.json';
import mockRecipients from '../fixtures/recipients-response.json';

Expand Down Expand Up @@ -45,7 +45,7 @@ class PatientComposePage {
};

verifySendMessageConfirmationMessageText = () => {
cy.get(Locators.ALERTS.ALERT_TEXT).should(
cy.get('[data-testid="alert-text"]').should(
'contain.text',
'Secure message was successfully sent.',
);
Expand All @@ -59,7 +59,7 @@ class PatientComposePage {
cy.get(Locators.ALERTS.REPT_SELECT).click();
cy.get(Locators.ALERTS.REPT_SELECT)
.shadow()
.find('[id="select"]')
.find('select')
.select(recipient, { force: true });
};

Expand Down Expand Up @@ -153,7 +153,7 @@ class PatientComposePage {
return cy
.get(Locators.MESSAGES_BODY)
.shadow()
.find('#textarea');
.find('textarea');
};

keyboardNavToMessageSubjectField = () => {
Expand All @@ -166,7 +166,7 @@ class PatientComposePage {
composeDraftByKeyboard = () => {
cy.tabToElement('#recipient-dropdown')
.shadow()
.find('#select')
.find('select')
.select(1, { force: true });
cy.tabToElement(Locators.BUTTONS.CATEGORY_RADIO_BUTTON)
.first()
Expand Down Expand Up @@ -300,7 +300,7 @@ class PatientComposePage {
verifyAlertModal = () => {
cy.get(`[modaltitle="We can't save this message yet"]`)
.shadow()
.find('[class="va-modal-inner va-modal-alert"]')
.find('[class="usa-modal va-modal-alert"]')
.should('contain', "We can't save this message yet");
};

Expand Down Expand Up @@ -388,17 +388,17 @@ class PatientComposePage {
};

verifyDeleteDraftSuccessfulMessage = () => {
cy.get(Locators.ALERTS.ALERT_TEXT).should(
cy.get('[data-testid="alert-text"]').should(
'contain.text',
Assertions.MESSAGE_CONVERSATION_SUCCESS_TRASH,
'Message conversation was successfully moved to Trash.',
);
};

verifySelectRecipientErrorMessage = () => {
cy.get(Locators.ALERTS.REPT_SELECT)
.shadow()
.find('[id="error-message"]')
.should('contain', Assertions.SELECT_RECIPIENT);
.should('contain', ' Please select a recipient.');
};

verifySubjectErrorMessage = () => {
Expand Down
@@ -1,4 +1,4 @@
import { Paths, Alerts, Locators } from '../utils/constants';
import { Paths, Alerts } from '../utils/constants';

class PatienErrorPage {
loadParticularFolderError = () => {
Expand Down Expand Up @@ -38,7 +38,7 @@ class PatienErrorPage {
};

verifyAlertMessage = () => {
cy.get(Locators.ALERTS.ALERT_TEXT)
cy.get('[data-testid="alert-text"]')
.should('be.visible')
.and('contain.text', Alerts.OUTAGE);
};
Expand Down
Expand Up @@ -443,13 +443,13 @@ class PatientInboxPage {

selectAdvancedSearchCategory = text => {
cy.get(Locators.FIELDS.CATEGORY_DROPDOWN)
.find('#select')
.find('select')
.select(text, { force: true });
};

selectAdvancedSearchCategoryCustomFolder = () => {
cy.get(Locators.FIELDS.CATEGORY_DROPDOWN)
.find('#select')
.find('select')
.select('Medication');
};

Expand All @@ -463,7 +463,7 @@ class PatientInboxPage {
composeMessage = () => {
cy.get('#recipient-dropdown')
.shadow()
.find('#select')
.find('select')
.select(1, { force: true });
cy.get(Locators.BUTTONS.CATEGORY_RADIO_BUTTON)
.first()
Expand All @@ -474,7 +474,7 @@ class PatientInboxPage {
.type('testSubject', { force: true });
cy.get('#compose-message-body')
.shadow()
.find('#textarea')
.find('textarea')
.type('testMessage', { force: true });
};

Expand Down Expand Up @@ -553,7 +553,7 @@ class PatientInboxPage {
sortMessagesByDate = (text, sortedResponse = mockSortedMessages) => {
cy.get(Locators.DROPDOWN)
.shadow()
.find('#select')
.find('select')
.select(`${text}`, { force: true });
cy.intercept(
'GET',
Expand Down

0 comments on commit 7a4cb9c

Please sign in to comment.