Skip to content

fix(profile): add missing UN member states to the country list - #2393

Closed
saisarans2007 wants to merge 1 commit into
Canopus-Labs:mainfrom
saisarans2007:fix/missing-un-countries
Closed

saisarans2007 wants to merge 1 commit into
Canopus-Labs:mainfrom
saisarans2007:fix/missing-un-countries

Conversation

@saisarans2007

@saisarans2007 saisarans2007 commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

The country allow-list in backend/utils/nameCountry.js was missing three UN member states: Antigua and Barbuda, Congo and Democratic Republic of the Congo. The profile update rejected them with "Please enter a valid country name." They're added in alphabetical order. I checked the list against all 193 UN members, and nothing else is missing.

Tests

Added backend/tests/nameCountry.unit.test.js:

  • the three countries are accepted. These fail on main.
  • matching stays case-insensitive and trims whitespace
  • non-countries are still rejected

npx vitest run: 23 files, 257 tests passing.

Closes #2392

Summary

  • Added Antigua and Barbuda, Congo, and the Democratic Republic of the Congo to the country allow-list.
  • Added unit tests for the three names, case-insensitive matching with surrounding whitespace, and rejection of invalid values.

The author reports that npx vitest run passed with 23 files and 257 tests.

isValidCountry rejected Antigua and Barbuda, Congo and the Democratic
Republic of the Congo, so users from those countries couldn't save their
country on the profile.
@github-actions

Copy link
Copy Markdown

Thank you for submitting your pull request, @saisarans2007! 🙌
We'll review it as soon as possible.
If there are any specific instructions or feedback regarding your PR, we'll provide them here.
Thanks again for your contribution to our project! 😊

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7fdac979-b520-4c38-9699-4f9ed40f5bcf
📥 Commits

Reviewing files that changed from the base of the PR and between a8d14cf and 384d1bd.

📒 Files selected for processing: 2
  • backend/tests/nameCountry.unit.test.js
  • backend/utils/nameCountry.js

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The country allow-list now includes Antigua and Barbuda, Congo, and Democratic Republic of the Congo. Unit tests cover selected accepted names, case-insensitive matching with surrounding spaces, and rejection of invalid inputs.

Changes: Country allow-list

Layer / File(s) Summary
Add country names and test validation
backend/utils/nameCountry.js, backend/tests/nameCountry.unit.test.js
The country list adds three names. Tests cover selected valid and invalid inputs, including case-insensitive matching with surrounding spaces.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 384d1

The requested country entries and validation tests are included; the change is ready to merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: adding missing UN member states to the country allow-list for profiles.
Linked Issues check Passed Issue #2392 requires isValidCountry to accept Antigua and Barbuda, Congo, and Democratic Republic of the Congo, with all 193 UN member states accepted. The PR summary reports all three names added t…
Out of Scope Changes check Passed The reported changes are limited to the country allow-list and its unit tests. These changes directly address issue #2392 and support its coding requirements. No unrelated change is identified.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Full details: Linked Issues check

Explanation

Issue #2392 requires isValidCountry to accept Antigua and Barbuda, Congo, and Democratic Republic of the Congo, with all 193 UN member states accepted. The PR summary reports all three names added to backend/utils/nameCountry.js and provides tests for their acceptance. The tests also cover case-insensitive matching, whitespace trimming, and rejection of non-countries. The reported Vitest run passes with 23 files and 257 tests.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 Biome (2.5.15)
backend/tests/nameCountry.unit.test.js

File contains syntax errors that prevent linting: Line 1: Illegal use of an import declaration outside of a module

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the merge ready PR is mergeable and has no conflicts label Oct 23, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

This pull request has had no activity for 14 days and has been marked as stale. If this is still being worked on, please push a commit or leave a comment within the next 7 days, otherwise it will be closed automatically.

@github-actions github-actions Bot added the stale label Nov 7, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed after 21 days of inactivity. Please reopen or raise a fresh PR rebased on the latest main branch if you would like to continue. Thank you!

@github-actions github-actions Bot closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge ready PR is mergeable and has no conflicts stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: profile rejects Congo, DR Congo and Antigua and Barbuda as invalid countries

1 participant