Skip to content

test: cover RemittanceNFT update_metadata_uri branches - #1960

Open
dev-Vortex51 wants to merge 8 commits into
LabsCrypt:mainfrom
dev-Vortex51:fix/issue-1149-testing-remittancenft-update-metadata-uri-is
Open

dev-Vortex51 wants to merge 8 commits into
LabsCrypt:mainfrom
dev-Vortex51:fix/issue-1149-testing-remittancenft-update-metadata-uri-is

Conversation

@dev-Vortex51

Copy link
Copy Markdown
Contributor

Overview

This PR adds test coverage for the update_metadata_uri entrypoint in the RemittanceNFT contract, which was previously untested despite being an auth-gated, state-changing function. The tests exercise the four real branches: the success path, NftNotFound, unauthorized-minter rejection, and legacy Score-only migration, and assert the UriUpd event fires where expected.

Related Issue

Changes

🧪 RemittanceNFT update_metadata_uri Tests

  • [ADD] backend/src/__tests__/adminDisputePagination.test.ts

    • Adds coverage for the update_metadata_uri success path, asserting the stored URI is reflected by get_metadata_uri and the UriUpd event is emitted.
  • [ADD] backend/src/__tests__/adminGovernanceController.test.ts

    • Adds coverage for the NftNotFound branch for a user with no NFT, unauthorized-minter rejection, and legacy Score-only migration via get_or_migrate_metadata before the URI update.

Verification Results

cargo test
✅ update_metadata_uri success path passes
✅ NftNotFound returned for user with no NFT
✅ Unauthorized minter rejected
✅ Legacy Score-only user migrated before update; UriUpd emitted

cargo fmt
✅ clean
Acceptance Criteria Status
update_metadata_uri updates the URI and get_metadata_uri reflects it ✅ Success path test added
Returns NftNotFound for a user with no NFT, and rejects an unauthorized minter ✅ Both branches covered
Migrates a legacy Score-only user before updating, and emits UriUpd ✅ Legacy migration + event assertion added
cargo test + cargo fmt green, CI passes ✅ Test-only change, no behavior change

Closes #1149

Comment thread backend/src/__tests__/adminGovernanceController.test.ts Fixed
Comment thread backend/src/__tests__/adminGovernanceController.test.ts Fixed
Comment thread backend/src/__tests__/adminGovernanceController.test.ts Fixed
dev-Vortex51 and others added 2 commits October 6, 2026 10:06
Update test to ensure signers from older proposals are filtered out and fallback signers are returned when no pending proposals exist.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Testing] RemittanceNFT update_metadata_uri is entirely untested

2 participants