Skip to content

Commit 29ca6e6

Browse files
fix(search): update OR-group tests to use comma delimiter
Reflect the corrected OR-group encoding: comma-separated alternatives within a single tag string (e.g. cat%2Cdog) instead of pipe.
1 parent c804689 commit 29ca6e6

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/booru/dto/booru-queries.dto.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ describe('booruQueryValuesPostsDTO', () => {
1212
expect(dto.tags).toEqual(['panty_&_stocking_with_garterbelt'])
1313
})
1414

15-
it('should preserve pipe-separated OR-group tokens as a single element and decode each part', () => {
15+
it('should preserve comma-separated OR-group as a single element and decode each part', () => {
1616
const dto = plainToInstance(booruQueryValuesPostsDTO, {
17-
tags: 'panty_%26_stocking_with_garterbelt|rating%3Asafe'
17+
tags: 'panty_%26_stocking_with_garterbelt%2Cblue_hair'
1818
})
1919

20-
expect(dto.tags).toEqual(['panty_&_stocking_with_garterbelt|rating:safe'])
20+
expect(dto.tags).toEqual(['panty_&_stocking_with_garterbelt,blue_hair'])
2121
})
2222

23-
it('should normalize array tag inputs and keep OR-group tokens intact', () => {
23+
it('should normalize array tag inputs and keep comma OR-group tokens intact', () => {
2424
const dto = plainToInstance(booruQueryValuesPostsDTO, {
25-
tags: ['panty_%26_stocking_with_garterbelt|rating%3Asafe', 'score%3A%3E100']
25+
tags: ['panty_%26_stocking_with_garterbelt%2Cblue_hair', 'score%3A%3E100']
2626
})
2727

2828
expect(dto.tags).toEqual([
29-
'panty_&_stocking_with_garterbelt|rating:safe',
29+
'panty_&_stocking_with_garterbelt,blue_hair',
3030
'score:>100'
3131
])
3232
})
@@ -75,4 +75,4 @@ describe('booruQueryValuesPostsDTO', () => {
7575
expect(dto.tags).toBeNull()
7676
})
7777
})
78-
})
78+
})

0 commit comments

Comments
 (0)