From fc553e10094acf737c1560a1471fdeea652f0963 Mon Sep 17 00:00:00 2001 From: lohit Date: Wed, 7 May 2025 22:24:52 +0530 Subject: [PATCH] fix sanitize name function tests in bruno-electron --- packages/bruno-electron/src/utils/filesystem.test.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/bruno-electron/src/utils/filesystem.test.js b/packages/bruno-electron/src/utils/filesystem.test.js index a6e2db53a..a0f0f018d 100644 --- a/packages/bruno-electron/src/utils/filesystem.test.js +++ b/packages/bruno-electron/src/utils/filesystem.test.js @@ -2,9 +2,13 @@ const { sanitizeName, isWSLPath, normalizeWSLPath, normalizeAndResolvePath } = r describe('sanitizeName', () => { it('should replace invalid characters with hyphens', () => { - const input = '<>:"/\|?*\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F'; - const expectedOutput = '----------------------------------------'; - expect(sanitizeName(input)).toEqual(expectedOutput); + expect(sanitizeName( + 'valid<>:"/\|?*\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F' + )).toEqual('valid----------------------------------------'); + + expect(sanitizeName( + '<>:"/\|?*\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1Fvalid<>:"/\|?*\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F' + )).toEqual('valid----------------------------------------'); }); it('should not modify valid directory names', () => {