Skip to content

Commit

Permalink
fixed cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed May 24, 2024
1 parent 501b5be commit 2a0a729
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions cypress/e2e/59_updateWorkspaceFeaturePhase.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ describe('Workspace Phasing Feature Tests', () => {
cy.login('alice');
cy.wait(1000);

const workspaceName = 'Dark Mode';
const workspaceName = 'Dark Mode 500';

const workspace = {
loggedInAs: 'alice',
Expand Down Expand Up @@ -53,9 +53,9 @@ describe('Workspace Phasing Feature Tests', () => {
cy.contains(newPhase).should('exist');
cy.wait(1000);

cy.get('.MaterialIcon').click();
cy.get('[data-testid="phase-option-btn"]').click();
cy.wait(500);
cy.contains('Edit').click();
cy.get('[data-testid="phase-edit-btn"]').click();
cy.wait(1000);

const editedPhase = 'Super Admin';
Expand All @@ -68,11 +68,11 @@ describe('Workspace Phasing Feature Tests', () => {

cy.get('[data-testid="phase-option-btn"]').click();
cy.wait(500);
cy.contains('Edit').click();
cy.get('[data-testid="phase-edit-btn"]').click();
cy.wait(1000);
cy.contains('Delete').click();
cy.wait(1000);
cy.contains('Delete').click();
cy.get('[data-testid="confirm-delete-phase"]').click();
cy.wait(1000);

cy.contains(editedPhase).should('not.exist');
Expand Down
2 changes: 1 addition & 1 deletion src/people/widgetViews/workspace/WorkspacePhase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const PhaseOptions = (props: PhaseOptionProps) => {
{showOptions && (
<WorkspaceOption>
<ul>
<li data-testid={`$phase-edit-btn`} onClick={close}>
<li data-testid={`phase-edit-btn`} onClick={close}>
Edit
</li>
</ul>
Expand Down
4 changes: 3 additions & 1 deletion src/people/widgetViews/workspace/WorkspacePhasingModals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ export const DeletePhaseModal = (props: ModalProps) => {
</CenteredText>
<ModalContainer>
<CancelButton onClick={onClose}>Cancel</CancelButton>
<DeleteButton onClick={onConfirmDelete}>Delete</DeleteButton>
<DeleteButton data-testid="confirm-delete-phase" onClick={onConfirmDelete}>
Delete
</DeleteButton>
</ModalContainer>
</ModalWrapper>
);
Expand Down

0 comments on commit 2a0a729

Please sign in to comment.