Skip to content

Commit

Permalink
add verify grouping on draft test
Browse files Browse the repository at this point in the history
  • Loading branch information
fazilqa committed Nov 27, 2024
1 parent 6cf8719 commit e226fdc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ import PatientInboxPage from './pages/PatientInboxPage';
import GeneralFunctionsPage from './pages/GeneralFunctionsPage';
import PatientComposePage from './pages/PatientComposePage';
import { AXE_CONTEXT, Locators, Data } from './utils/constants';
import PatientMessageDraftsPage from './pages/PatientMessageDraftsPage';

describe('SM RECIPIENTS GROUPING', () => {
const updatedFeatureToggles = GeneralFunctionsPage.updateFeatureToggles(
`mhv_secure_messaging_recipient_opt_groups`,
true,
);
it('verify grouping on compose', () => {
beforeEach(() => {
SecureMessagingSite.login(updatedFeatureToggles);
PatientInboxPage.loadInboxMessages();
});
it('verify grouping on compose', () => {
PatientInboxPage.navigateToComposePage();
PatientComposePage.verifyHeader(Data.START_NEW_MSG);

Expand All @@ -31,4 +34,26 @@ describe('SM RECIPIENTS GROUPING', () => {
cy.injectAxe();
cy.axeCheck(AXE_CONTEXT);
});

it('verify grouping on draft', () => {
PatientMessageDraftsPage.loadDrafts();
PatientMessageDraftsPage.loadSingleDraft();
PatientComposePage.verifyHeader(Data.EDIT_DRAFT);

cy.get(Locators.DROPDOWN.RECIPIENTS)
.find(`optgroup`)
.should(`have.length`, 4);

cy.get(Locators.DROPDOWN.RECIPIENTS)
.find(`optgroup`)
.each(el => {
cy.wrap(el)
.find(`option`)
.its(`length`)
.should(`be.greaterThan`, 0);
});

cy.injectAxe();
cy.axeCheck(AXE_CONTEXT);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ export const Data = {
SAMPLE_XLS: 'sample_XLS.xls',
SAMPLE_IMG: 'test_image.gif',
START_NEW_MSG: 'Start a new message',
EDIT_DRAFT: 'Edit draft',
GO_YOUR_INBOX: 'Go to your inbox',
BACK_TO_MSG: 'Back to messages',
FOLDER_NAME_CANNOT_BLANK: 'Folder name cannot be blank',
Expand Down

0 comments on commit e226fdc

Please sign in to comment.