diff options
Diffstat (limited to 'spec/frontend/lib/utils/ref_validator_spec.js')
-rw-r--r-- | spec/frontend/lib/utils/ref_validator_spec.js | 23 |
1 files changed, 20 insertions, 3 deletions
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); + }); + }); }); }); |