From 6fbaac1974d2e9a0e5296a9da2d99f356a684f91 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 21 Jun 2023 00:07:56 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/frontend/lib/utils/ref_validator_spec.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'spec/frontend/lib') diff --git a/spec/frontend/lib/utils/ref_validator_spec.js b/spec/frontend/lib/utils/ref_validator_spec.js index 7185ebf0a24..97896d74dff 100644 --- a/spec/frontend/lib/utils/ref_validator_spec.js +++ b/spec/frontend/lib/utils/ref_validator_spec.js @@ -65,9 +65,6 @@ describe('~/lib/utils/ref_validator', () => { ['foo.123.', validationMessages.DisallowedSequencePostfixesValidationMessage], ['foo/', validationMessages.DisallowedPostfixesValidationMessage], - - ['control-character\x7f', validationMessages.ControlCharactersValidationMessage], - ['control-character\x15', validationMessages.ControlCharactersValidationMessage], ])('tag with name "%s"', (tagName, validationMessage) => { it(`should be invalid with validation message "${validationMessage}"`, () => { const result = validateTag(tagName); @@ -75,5 +72,25 @@ describe('~/lib/utils/ref_validator', () => { expect(result.validationErrors).toContain(validationMessage); }); }); + + // NOTE: control characters cannot be used in test names because they cause test report XML parsing errors + describe.each([ + [ + 'control-character x7f', + 'control-character\x7f', + validationMessages.ControlCharactersValidationMessage, + ], + [ + 'control-character x15', + 'control-character\x15', + validationMessages.ControlCharactersValidationMessage, + ], + ])('tag with name "%s"', (_, tagName, validationMessage) => { + it(`should be invalid with validation message "${validationMessage}"`, () => { + const result = validateTag(tagName); + expect(result.isValid).toBe(false); + expect(result.validationErrors).toContain(validationMessage); + }); + }); }); }); -- cgit v1.2.3