fix: close remove-association confirm dialog after mutation succeeds#140
Open
Rishavraaj wants to merge 2 commits into
Open
fix: close remove-association confirm dialog after mutation succeeds#140Rishavraaj wants to merge 2 commits into
Rishavraaj wants to merge 2 commits into
Conversation
The ConfirmDialog for removing a contact or company from a deal/company detail page was not closing after the mutation completed because the onSuccess handlers never reset the state variables that control the dialog's open prop. Added setContactToRemove(null) and setCompanyToRemove(null) as the first action in each onSuccess handler so the dialog closes immediately once the API call succeeds. Also adds unit tests covering the open/close/cancel behaviour and E2E tests verifying the dialog closes without requiring manual Escape. Removes the Escape-key workaround from CompanyDetailPage.removeContact and adds removeContact/removeCompany helpers to DealDetailPage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- BasePage.updateTableCell: date and number inputs save on blur, not Enter. Detect input type and call blur() for those types so the 'can create a new deal' date-column edit no longer times out. - Deal Associations - Company Removal Dialog: create a fresh company in beforeAll so the 'Add Company' dropdown is never empty in a clean test environment. - Company contact removal test: after the confirm dialog closes, wait for the contact link to detach from the DOM before asserting isContactAssociated, avoiding a race with the refetch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
onSuccesshandlers inremoveContactMutationandremoveCompanyMutationwere missing the state reset calls, so the dialog stayed openindefinitely
setContactToRemove(null)/setCompanyToRemove(null)at the start of eachonSuccessFiles Changed
DealDetail.tsx— reset contact and company remove state on mutation successCompanyDetail.tsx— reset contact remove state on mutation successTests
deals.test.tsxandcompanies.test.tsxdeals.spec.tsverifying the dialog closes automatically after confirming removalcompanies.spec.tsto assert the dialog closes without pressing EscapeCompanyDetailPage.removeContact()removeContactandremoveCompanyhelpers toDealDetailPageTest Plan