Skip to content

Commit 8721d60

Browse files
committed
Re-enable and fix errorHandling tests
- Updated errorHandling.cy.ts to re-enable the previously skipped "Gracefully handle missing project" test. - Fixed test selectors to match the recent UI changes for accessing the edit message and uncommit actions. - Improved robustness of commit drawer interactions using data-testid attributes for menu access. These changes collectively improve and reactivate error handling and commit management tests.
1 parent 5eb7b0d commit 8721d60

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

apps/desktop/cypress/e2e/errorHandling.cy.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,15 @@ describe('Error handling - commit actions', () => {
4747
cy.getByTestId('commit-row').first().should('contain', originalCommitMessage).click();
4848

4949
// Should open the commit drawer
50-
cy.get('.commit-view').first().should('contain', originalCommitMessage);
50+
cy.getByTestId('commit-drawer-title').first().should('contain', originalCommitMessage);
5151

52-
// Click on the edit message button
53-
cy.getByTestId('commit-drawer-action-edit-message').should('contain', 'Edit message').click();
52+
// Click on the kebab menu to access edit message
53+
cy.getByTestId('commit-drawer').within(() => {
54+
cy.getByTestId('kebab-menu-btn').click();
55+
});
56+
57+
// Click on the edit message button in the context menu
58+
cy.getByTestId('commit-row-context-menu-edit-message-menu-btn').should('be.enabled').click();
5459

5560
// Should open the commit rename drawer
5661
cy.getByTestId('edit-commit-message-box').should('be.visible');
@@ -271,8 +276,12 @@ describe('Error handling - commit actions', () => {
271276
// Should open the commit drawer
272277
cy.getByTestId('commit-drawer').first().should('be.visible');
273278

274-
// Click on the uncommit button
275-
cy.getByTestId('commit-drawer-action-uncommit').click();
279+
// Click on the kebab menu to access edit message
280+
cy.getByTestId('commit-drawer').within(() => {
281+
cy.getByTestId('kebab-menu-btn').click();
282+
});
283+
284+
cy.getByTestId('commit-row-context-menu-uncommit-menu-btn').should('be.enabled').click();
276285

277286
// Should show the error message
278287
cy.getByTestId('toast-info-message')
@@ -290,7 +299,7 @@ describe('Error handling - project acitons', () => {
290299
});
291300
});
292301

293-
it.only('Gracefully handle missing project', () => {
302+
it('Gracefully handle missing project', () => {
294303
cy.getByTestId('project-not-found-page').should('be.visible');
295304
});
296305
});

0 commit comments

Comments
 (0)