Conversation
f98e4d0 to
577dd4c
Compare
Signed-off-by: Lucas <lucasoneil@gmail.com>
7ef9c79 to
487d8ae
Compare
There was a problem hiding this comment.
Pull request overview
Updates postal code validation to separate “format validity” from “requiredness” and adds unit tests for the new required-postal-code validator.
Changes:
- Renamed postal code validator to
isValidPostalCodeand updated existing unit tests. - Added new
isRequiredPostalCodevalidator plus a dedicated unit test suite. - Updated validation mixin to support both
isValidPostalCodeandisRequiredPostalCoderules.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/validate-postal-code.spec.ts | Updates tests to use isValidPostalCode and adds null/undefined coverage. |
| tests/unit/is-required-postal-code.spec.ts | New unit tests for required postal code behavior across country sets. |
| src/validators/validate-postal-code.ts | Renames exported validator function to isValidPostalCode. |
| src/validators/is-required-postal-code.ts | Introduces isRequiredPostalCode validator and country allowlist. |
| src/validators/index.ts | Updates validator exports to include isValidPostalCode and isRequiredPostalCode. |
| src/mixins/validation-mixin.ts | Adds rule wiring for isValidPostalCode and isRequiredPostalCode. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
severinbeauvais
approved these changes
Feb 9, 2026
Collaborator
severinbeauvais
left a comment
There was a problem hiding this comment.
LGTM.
I don't care if you streamline the unit tests or not.
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.
Issue #: /bcgov/entity#31954
Description of changes:
Add a new postal code required validator that depends on country code as well.
Refactor-rename existing format validation for postal code as well
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the business-filings-ui license (Apache 2.0).