Skip to content

[Testing] Navigation deep link parsing has no unit tests for malformed URLs #844

Description

@RUKAYAT-CODER

Overview

The React Navigation deep link configuration parses custom URL schemes (teachlink://) but there are no tests for malformed, missing-parameter, or malicious URL inputs. A crafted URL could navigate the user to unintended screens.

Specifications

Features:

  • Write unit tests for valid deep links, missing parameters, extra parameters, and encoded/malicious URLs
  • Verify that unknown routes fall back to a safe default screen

Tasks:

  • Create __tests__/linkingConfig.test.ts
  • Add test cases for: valid URL, missing token, XSS-in-URL, unknown route
  • Assert navigation output for each case

Impacted Files:

  • src/navigation/linkingConfig.ts
  • __tests__/linkingConfig.test.ts (new)

Acceptance Criteria

  • All test cases pass
  • Malicious URLs do not navigate to unintended screens
  • Unknown routes fall back to the home screen

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions