Skip to content

feat(PLAT-553): Support for alphanumeric CNPJ with normalization to uppercase#600

Open
MarcosViniciusPC wants to merge 6 commits into
masterfrom
PLAT-553
Open

feat(PLAT-553): Support for alphanumeric CNPJ with normalization to uppercase#600
MarcosViniciusPC wants to merge 6 commits into
masterfrom
PLAT-553

Conversation

@MarcosViniciusPC
Copy link
Copy Markdown
Contributor

@MarcosViniciusPC MarcosViniciusPC commented May 21, 2026

Task

https://jirasoftware.catho.com.br/browse/PLAT-553

This pull request updates the CNPJ input component to support alphanumeric values (for the first 12 digits), ensures the last two digits are numeric, and automatically transforms input to uppercase. It also adds comprehensive tests for these changes and updates the CNPJ mask logic to enforce the new rules.

This pull request updates the GitHub Actions workflows to use a newer Ubuntu version and removes regression test steps from the CI pipeline. It also modifies the .gitignore file in the .loki directory.

CI/CD Workflow Updates:

  • Updated the runner environment from ubuntu-20.04 to ubuntu-22.04 in both .github/workflows/actions-development.yml and .github/workflows/actions-publish.yml for improved compatibility and security. [1] [2] [3]

  • Removed the regression test steps (yarn build:regression) from both workflow files, streamlining the CI process to only run unit tests. [1] [2]

Repository Maintenance:

  • Removed current and difference from .loki/.gitignore, which may affect how visual regression artifacts are tracked in version control.# Task

CNPJ Input Improvements:

  • Updated the masks.cnpj mask in masks.js to allow alphanumeric characters for the first 12 positions and restrict the last two positions to numeric digits only.
  • Added a cnpjPipe function in InputTypes.jsx to automatically transform CNPJ input to uppercase while typing, and applied it to the Input.CNPJ component.

Testing Enhancements:

  • Added and updated unit tests in Input.unit.test.jsx to verify that the CNPJ input allows alphanumeric characters, ignores symbols, keeps the last two digits numeric, and transforms input to uppercase.
  • Added new tests in masks.unit.test.js to ensure the CNPJ mask correctly enforces alphanumeric and numeric-only rules for the appropriate positions.

Other:

  • Minor update to the test:regression:storybook script in package.json to remove the fuser command.

@sonarqubecloud
Copy link
Copy Markdown

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.

4 participants