[stable32] test: add business rules coverage#6818
Merged
vitormattos merged 9 commits intostable32from Feb 9, 2026
Merged
Conversation
- Add comprehensive tests for getSignerLabel fallback chain - Add tests for hasMultipleSigners detection - Add tests for startAddingSigner validation - Add tests for addSigner coordinate calculations - Add tests for event handling (delete, object click) - Add tests for cancelAdding method - Add tests for readOnly prop behavior - Use shared mock methods for better testability - Ensure proper cleanup with vi.clearAllMocks Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add tests for sign button visibility logic - Add tests for sign button variant determination - Add tests for showAddSignersMessage conditional display - Add tests for showVisibleElementsMessage validation - Mock asyncReader to avoid pdfjs warnings - Properly handle async setup in beforeEach - Test integration with filesStore methods (canSign, canAddSigner) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add tests for showDocMdpWarning when DocMDP prevents changes - Add tests for isOriginalFileDeleted detection - Add tests for isEnvelope and envelopeFilesCount - Add tests for hasSigners detection - Add tests for showPreserveOrder with multiple signers - Add tests for showViewOrderButton in ordered flow - Add tests for showSaveButton and showRequestButton permission logic - Add tests for showSigningProgress display - Add tests for canEditSigningOrder in ordered flow - Add tests for canDelete, canRequestSignature, canSendReminder permissions - Add tests for canCustomizeMessage with identification methods - Use reactive store updates via addFile for Vue 2 compatibility - Mock router functions (generateUrl, getRootUrl) and asyncReader - Properly align signer fixtures with component logic Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Introduce createLongPolling factory for better testability - Add optional dependency injection for waitForFileStatusChange and sleep - Maintain backward compatibility with existing startLongPolling API - Allow tests to inject mock dependencies without affecting production code - Follow Talk (spreed) testing patterns for long polling services - Keep terminal status detection and error handling logic intact Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add tests for waitForFileStatusChange with timeout and params - Add tests for continuous polling until status change - Add tests for terminal status detection (stops on SIGNED, DELETED, DRAFT) - Add tests for shouldStop callback interruption - Add tests for onUpdate callback invocation - Add tests for error handling and retry with backoff - Add tests for stopping after MAX_ERRORS consecutive failures - Add tests for onError callback invocation - Add tests for manual polling stop via returned function - Remove real timers to avoid slow tests - Use console.error suppression where test-setup throws - Inject sleep override for deterministic error backoff tests - Avoid terminal status 1 in non-terminal polling sequences Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add tests for canSign method with various scenarios - Add tests for canValidate when document partially or fully signed - Add tests for canDelete permission checks - Add tests for canAddSigner with DocMDP and deleted file validation - Add tests for isDocMdpNoChangesAllowed detection - Add tests for isOriginalFileDeleted metadata check - Add tests for canSave permission logic - Add tests for file renaming functionality - Mock axios.patch for rename operations - Suppress console.error in error scenarios where test-setup throws - Test integration with currentUser and file ownership Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add array validation in hasSigners before length check - Add array validation in isPartialSigned before filter - Add array validation in isFullSigned before filter - Prevent runtime errors when signers is not an array - Improve defensive programming and robustness Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Remove debug console.error in filter_status parsing - Keep error handling logic intact with try-catch - Return empty array on parse failure as expected Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add Array.isArray validation in canSignerActInOrder - Add Array.isArray validation in hasAnyDraftSigner - Add Array.isArray validation in hasSequentialDraftSigners - Add Array.isArray validation in hasOrderDraftSigners - Prevent runtime errors when file.signers is not an array - Use empty array fallback for safe array method calls - Improve component robustness and error handling Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.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.
Backport of PR #6817