Skip to content

Commit

Permalink
Update operation buttons data-test attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
fongsean committed Nov 27, 2023
1 parent 3015e87 commit 06377d5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 40 deletions.
2 changes: 1 addition & 1 deletion apps/smart-forms-app/cypress/e2e/saving.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('save response', () => {
cy.getByData('q-item-integer-box').eq(0).find('input').clear().wait(50);
cy.initAgeValue(60);

cy.getByData('list-button-renderer-operation');
cy.getByData('renderer-operation-item');
cy.contains('Save as Final').click();
cy.get('.MuiButtonBase-root').contains('Save as final').click();

Expand Down
2 changes: 1 addition & 1 deletion apps/smart-forms-app/cypress/e2e/viewer.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('response viewer', () => {
});

it('print preview', () => {
cy.getByData('list-button-viewer-operation');
cy.getByData('renderer-operation-item');
cy.contains('Print Preview').should('be.visible');
});
});
Expand Down
12 changes: 6 additions & 6 deletions apps/smart-forms-app/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,28 @@ Cypress.Commands.add('getByData', (selector, ...args) => {
});

Cypress.Commands.add('previewForm', () => {
cy.getByData('list-button-renderer-operation');
cy.getByData('renderer-operation-item');
cy.contains('Preview').click();
cy.location('pathname').should('eq', '/renderer/preview');
});

Cypress.Commands.add('clickOnNavPage', (operationName: string) => {
cy.getByData('list-button-renderer-nav-page');
cy.getByData('renderer-operation-item');
cy.contains(operationName).click();
});

Cypress.Commands.add('clickOnRendererOperation', (operationName: string) => {
cy.getByData('list-button-renderer-operation');
cy.getByData('renderer-operation-item');
cy.contains(operationName).click();
});

Cypress.Commands.add('clickOnViewerOperation', (operationName: string) => {
cy.getByData('list-button-viewer-operation');
cy.getByData('renderer-operation-item');
cy.contains(operationName).click();
});

Cypress.Commands.add('editForm', () => {
cy.getByData('list-button-renderer-operation');
cy.getByData('renderer-operation-item');
cy.contains('Editor').click();
cy.location('pathname').should('eq', '/renderer');
});
Expand Down Expand Up @@ -102,7 +102,7 @@ Cypress.Commands.add('launchFromSMARTHealthIT', () => {
});

Cypress.Commands.add('goToResponsesPage', () => {
cy.getByData('list-button-dashboard-nav-page');
cy.getByData('renderer-operation-item');
cy.contains('Responses').click();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function DashboardNavItem(props: DashboardNavItemProps) {
to={path}
disableGutters
disabled={disabled}
data-test="list-button-dashboard-nav-page"
data-test="renderer-operation-item"
onClick={() => {
setSelectedQuestionnaire(null);
onCloseNav();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function ViewerOperationItem(props: OperationItem) {
disableGutters
onClick={onClick}
disabled={disabled}
data-test="list-button-viewer-operation">
data-test="renderer-operation-item">
<StyledNavItemIcon>{icon}</StyledNavItemIcon>

<ListItemText disableTypography primary={title} />
Expand Down
31 changes: 1 addition & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 06377d5

Please sign in to comment.