Merged
Conversation
Add comprehensive test coverage for additional store methods: - isDocumentPending(): verify pending state when enabled/disabled - showDocumentsComponent(): verify component visibility - needIdentificationDocument(): verify multiple scenarios - toggleModal(): verify modal visibility toggle All scenarios tested for both enabled and disabled states. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add comprehensive test coverage for handleRouteChange method: - Verify sidebar visibility is preserved for allowed routes: * fileslist, SignPDF, ValidationFile, IdDocsApprove - Verify sidebar is hidden for non-allowed routes - Verify sidebar is hidden when navigating to home - Handle edge cases (null/undefined route names gracefully) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add import of SIGN_REQUEST_STATUS constant and expand test coverage: - Add identificationDocument store mock - Add tests for approver scenarios without signer - Add identification document pending check for approvers - Add approver DRAFT status validation - Add idDocApproval URL parameter tests - Add getSignatureMethodsForFile() method tests - Test fallback to file settings when no signer methods exist Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add tests for signer validation with draft files: - testValidateSignerAllowsDraftWhenFileHasIdDocs: verify draft is allowed when file has identification documents attached - testValidateSignerBlocksDraftWhenFileHasNoIdDocs: verify draft is blocked when no identification documents exist These tests ensure proper validation of draft signatures based on identification document availability. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Refactor test data providers to use PHP 8+ attributes: - Add import for DataProvider attribute from PHPUnit - Migrate from @dataProvider annotations to #[DataProvider] attributes: * providerTestValidateCertificateDataUsingDataProvider → provideValidateCertificateDataCases (with named test cases) * New: provideValidateCreateToSignCases with multiple scenarios: - Invalid UUID validation - UUID not found handling - Email mismatch detection - User already exists check - Empty password validation - File not found scenarios All test cases include descriptive keys for better test reporting. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Refactor test to use PHP 8+ data provider attributes:
- Add DataProvider attribute import
- Migrate from individual test methods to parameterized test:
* Consolidate multiple testGetSettings* methods
* Create providerGetSettings() with 7 comprehensive scenarios:
- User in authorized group with/without signature
- User not in authorized group
- User with/without signature file
- Null user handling
- Empty approval groups
- Multiple approval groups with/without matches
Use #[DataProvider] attribute for cleaner test organization.
All test cases include descriptive keys for better reporting.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add tests for SignRequest handling in FileResponseOptions: - testDefaultSignRequestIsNull: verify SignRequest is null by default - testCanSetSignRequest: verify ability to set and retrieve SignRequest - testCanSetSignRequestToNull: verify ability to clear SignRequest Include SignRequest import from OCA\Libresign\Db namespace. Tests verify fluent interface compatibility for method chaining. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Major refactoring to use PHP 8+ attributes and parameterized tests:
Add imports:
- SignRequest entity for test mocking
- DataProvider attribute from PHPUnit
Consolidate identification document status tests:
- Create providerGetIdentificationDocumentsStatus() with 11 scenarios:
* Disabled feature handling
* No files → NEED_SEND
* All deleted files → NEED_SEND
* Mixed signed/draft → NEED_APPROVAL
* All signed → APPROVED
* User in approval group → APPROVED
* SignRequest scenarios with various file states
* Edge cases (null user/signRequest)
* Single vs multiple file states
Consolidate user identification settings tests:
- Create providerGetUserIdentificationSettings() with 7 scenarios:
* All feature states (disabled/enabled)
* All identification statuses (NEED_SEND, NEED_APPROVAL, APPROVED)
* User and signRequest variations
* Expected outcomes for needIdentificationDocuments and
identificationDocumentsWaitingApproval
Migrate from individual test methods to single parameterized methods
using #[DataProvider] attributes. All test cases include descriptive keys.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Simplify and reorganize IdDocsServiceTest: - Remove unnecessary mock dependencies and imports - Keep only essential mocks for IdDocsService: * IL10N, FileTypeMapper, IdDocsMapper * FileMapper, SignRequestMapper, IdentifyMethodMapper * ValidateHelper, RequestSignatureService, TimeFactory, IAppConfig Remove unused AccountService-related test methods. Keep core deletion tests: - testDeleteIdDocAsApproverBypassesOwnershipCheck: approver can delete - testDeleteIdDocAsNonApproverValidatesOwnership: non-approver must own doc - testDeleteIdDocBySignRequestValidatesAndDeletes: delete via sign request - testDeleteIdDocBySignRequestThrowsOnInvalidDoc: error on invalid doc Improve getService() method to use proper constructor injection for IdDocsService instead of AccountService. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add comprehensive tests for getSignRequestToSign method: 1. testGetSignRequestToSignUsesUuid: retrieve sign request by UUID - Validates file can be signed - Fetches correct sign request from mapper - Sets sequential signing context 2. testGetSignRequestToSignCreatesApproverSignRequest: approver flow - Creates new sign request for approvers - Validates approver has id docs to sign - Uses createOrUpdateSignRequest service 3. testGetSignRequestToSignFindsByIdentifyMethod: identify method matching - Test multiple identifier types (email, account) - Correct matching by UID or email address - Multiple sign requests with different identifiers - Exception on no match found 4. testGetSignRequestToSignFallsBackWhenApproverCreationFails: error handling - Gracefully falls back when id docs don't exist - Searches existing sign requests on failure - Returns matching sign request by identifier Include import of IdDocs entity for test mocking. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Member
Author
|
/backport to stable33 |
Member
Author
|
/backport to stable32 |
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This was referenced Feb 16, 2026
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.
No description provided.