From da172ff9b511feb276dceae62e26c0ad91ded7e7 Mon Sep 17 00:00:00 2001 From: lohit Date: Wed, 7 May 2025 22:12:57 +0530 Subject: [PATCH] fix sanitize name function tests --- packages/bruno-app/src/utils/common/regex.spec.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/bruno-app/src/utils/common/regex.spec.js b/packages/bruno-app/src/utils/common/regex.spec.js index e7a8b8d36..3994a2b2d 100644 --- a/packages/bruno-app/src/utils/common/regex.spec.js +++ b/packages/bruno-app/src/utils/common/regex.spec.js @@ -23,8 +23,8 @@ describe('regex validators', () => { }); it('should remove trailing periods', () => { - expect(sanitizeName('.file')).toBe('file'); - expect(sanitizeName('.file.')).toBe('file'); + expect(sanitizeName('.file')).toBe('.file'); + expect(sanitizeName('.file.')).toBe('.file'); expect(sanitizeName('file.')).toBe('file'); expect(sanitizeName('file.name.')).toBe('file.name'); expect(sanitizeName('hello world.')).toBe('hello world'); @@ -83,11 +83,11 @@ describe('regex validators', () => { it('should handle filenames with multiple consecutive periods (only remove trailing)', () => { expect(sanitizeName('file.name...')).toBe('file.name'); - expect(sanitizeName('...file')).toBe('file'); + expect(sanitizeName('...file')).toBe('...file'); expect(sanitizeName('file.name... ')).toBe('file.name'); - expect(sanitizeName(' ...file')).toBe('file'); - expect(sanitizeName(' ...file ')).toBe('file'); - expect(sanitizeName(' ...file.... ')).toBe('file'); + expect(sanitizeName(' ...file')).toBe('...file'); + expect(sanitizeName(' ...file ')).toBe('...file'); + expect(sanitizeName(' ...file.... ')).toBe('...file'); }); it('should handle very long filenames', () => {