Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(validation): correctly validate empty not required data #1606

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

soleksy-splunk
Copy link
Contributor

@soleksy-splunk soleksy-splunk commented Feb 28, 2025

Issue number:
https://splunk.atlassian.net/browse/ADDON-78393

PR Type

What kind of change does this PR introduce?

  • Feature
  • Bug Fix
  • Refactoring (no functional or API changes)
  • Documentation Update
  • Maintenance (dependency updates, CI, etc.)

Summary

Changes

N/A do not throw error if number undefined and not required.

User experience

When copying entity right now correctly verify number value.

Checklist

If an item doesn't apply to your changes, leave it unchecked.

@soleksy-splunk soleksy-splunk requested a review from a team as a code owner February 28, 2025 11:54
@soleksy-splunk soleksy-splunk changed the title fix: number validation undefined fix(validation): correctly validate empty not required data Feb 28, 2025
@vtsvetkov-splunk
Copy link
Contributor

should we link this?
https://splunk.atlassian.net/browse/ADDON-78393

@soleksy-splunk
Copy link
Contributor Author

should we link this? https://splunk.atlassian.net/browse/ADDON-78393

yea lets link it.

@@ -210,6 +212,29 @@ describe('Validator.doValidation - number case', () => {
expect(result).toBe(false);
});

it.each([undefined, null])(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible that data === ''?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the number no. But i actually created a test for it just in case in a separate PR

@pull-request-size pull-request-size bot added size/S and removed size/M labels Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants