Skip to content

Commit

Permalink
fix: switch to using intercept method
Browse files Browse the repository at this point in the history
  • Loading branch information
fboulnois committed Nov 13, 2024
1 parent e7cbf80 commit 8583803
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cypress/component/UserProfile/user_profile.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ describe('User Profile', () => {
cy.stub(User, 'getMe').returns(duosUser);
cy.stub(User, 'getApprovedDatasets').returns([]);
cy.stub(User, 'getAcknowledgements').returns({});
cy.intercept(
{method: 'PUT', url: '**/user'},
{statusCode: 200, body: duosUser}
).as('updateSelf');
mount(<UserProfile/>);
cy.get('select[id="profileEmailEnabled"]').select(true);
cy.get('div').contains('Email preference updated successfully!');
cy.get('input[id="profileEmailEnabled_yes"]').check();
cy.wait('@updateSelf').then(() => {
cy.get('div').contains('Email preference updated successfully!');
});
});
});

0 comments on commit 8583803

Please sign in to comment.