Skip to content

Commit 046262b

Browse files
committed
fix: image upload tests
1 parent 3d4e287 commit 046262b

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

npm-app/src/__tests__/image-upload.test.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,15 @@ describe('Image Upload Functionality', () => {
169169
expect(paths).toEqual(['./ConstellationFS Demo · 1.21am · 09-11.jpeg', '../images/café ñoño (2024).png'])
170170
})
171171

172-
test('should auto-detect paths with spaces and special characters', () => {
173-
const input =
174-
'/Users/brandonchen/Downloads/ConstellationFS Demo · 1.21am · 09-11.jpeg'
172+
test('should require quotes for paths with spaces to avoid false positives', () => {
173+
const input = '/Users/brandonchen/Downloads/ConstellationFS Demo · 1.21am · 09-11.jpeg'
175174
const paths = extractImagePaths(input)
176-
expect(paths).toEqual([
177-
'/Users/brandonchen/Downloads/ConstellationFS Demo · 1.21am · 09-11.jpeg',
178-
])
175+
// Unquoted paths with spaces are not auto-detected to avoid false positives
176+
expect(paths).toEqual([])
179177
})
180178

181-
test('should handle standalone paths with spaces as the entire input', () => {
182-
const input = ' /Users/test/My Documents/screenshot file.png '
179+
test('should detect quoted paths with spaces', () => {
180+
const input = '"/Users/test/My Documents/screenshot file.png"'
183181
const paths = extractImagePaths(input)
184182
expect(paths).toEqual(['/Users/test/My Documents/screenshot file.png'])
185183
})

0 commit comments

Comments
 (0)