fix: error message for input widget updated for when the default value is more than the max chars allowed (#17885)

* bug fixed and test case written

* removed the test case

* changes to fix ui-test set status in the PR
This commit is contained in:
Rishabh Kashyap 2022-11-25 11:21:55 +05:30 committed by GitHub
parent 8e9ce96565
commit 62756dd89c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -18,7 +18,9 @@ describe("Input Widget Max Char Functionality", function() {
it("Text Input maxChar shows error if defaultText longer", () => {
cy.get(widgetsPage.innertext).click();
cy.get(".bp3-popover-content").should(($x) => {
expect($x).contain("Default text length must be less than 5 characters");
expect($x).contain(
"Default text length must be less than or equal to 5 characters",
);
});
});

View File

@ -38,7 +38,9 @@ describe("Text Field Property Control", () => {
cy.testJsontext("maxchars", 5);
cy.get(`${fieldPrefix}-name input`).click();
cy.get(".bp3-popover-content").should(($x) => {
expect($x).contain("Default text length must be less than 5 characters");
expect($x).contain(
"Default text length must be less than or equal to 5 characters",
);
});
cy.testJsontext("maxchars", "");
});

View File

@ -28,7 +28,7 @@ export const ERROR_EMPTY_APPLICATION_NAME = () =>
export const API_PATH_START_WITH_SLASH_ERROR = () => `Path cannot start with /`;
export const FIELD_REQUIRED_ERROR = () => `This field is required`;
export const INPUT_DEFAULT_TEXT_MAX_CHAR_ERROR = (max: number) =>
`Default text length must be less than ${max} characters`;
`Default text length must be less than or equal to ${max} characters`;
export const INPUT_TEXT_MAX_CHAR_ERROR = (max: number) =>
`Input text length must be less than ${max} characters`;
export const INPUT_DEFAULT_TEXT_MAX_NUM_ERROR = () =>