Fix one-off error in secret variable length check (#32386)

For #32381.
This commit is contained in:
Lucas Manuel Rodriguez
2025-08-27 20:33:22 -03:00
committed by GitHub
parent 20febd0822
commit 7341249025
2 changed files with 4 additions and 4 deletions
@@ -305,12 +305,12 @@ describe("Custom variables", () => {
});
it("does not allow saving very long name", async () => {
const { nameInput, valueInput, saveButton } = await getAddSecretUI();
await user.type(nameInput, new Array(300).fill("A").join("")); // Invalid name
await user.type(nameInput, new Array(256).fill("A").join("")); // Invalid name
await user.type(valueInput, "a value");
await user.click(saveButton);
await waitFor(() => {
expect(
screen.getByText("Name may not exceed 256 characters")
screen.getByText("Name may not exceed 255 characters")
).toBeInTheDocument();
expect(saveButton).toBeDisabled();
});
@@ -53,9 +53,9 @@ const FORM_VALIDATIONS: IFormValidations = {
{
name: "notTooLong",
isValid: (formData: IAddSecretModalScheduleFormData) => {
return formData.name.length <= 256;
return formData.name.length <= 255;
},
message: "Name may not exceed 256 characters",
message: "Name may not exceed 255 characters",
},
{
name: "doesNotIncludePrefix",