musora-content-services 2.102.1 → 2.102.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/package.json +3 -2
- package/src/lib/sanity/filter.ts +460 -0
- package/src/lib/sanity/query.ts +5 -3
- package/src/services/content/artist.ts +29 -31
- package/src/services/content/genre.ts +30 -31
- package/src/services/content/instructor.ts +28 -28
- package/test/lib/__snapshots__/filter.test.ts.snap +5 -0
- package/test/lib/filter.test.ts +1148 -0
- package/test/lib/{query.test.js → query.test.ts} +3 -3
|
@@ -115,7 +115,7 @@ describe('Sanity Query Builder', () => {
|
|
|
115
115
|
})
|
|
116
116
|
|
|
117
117
|
test('overrides previous slice when called multiple times', () => {
|
|
118
|
-
const result = query().and('_type == "course"').slice(0, 10).slice(10,
|
|
118
|
+
const result = query().and('_type == "course"').slice(0, 10).slice(10, 10).build()
|
|
119
119
|
expect(result).toContain('*[_type == "course"]')
|
|
120
120
|
expect(result).toContain('[10...20]')
|
|
121
121
|
expect(result).not.toContain('[0...10]')
|
|
@@ -358,7 +358,7 @@ describe('Sanity Query Builder', () => {
|
|
|
358
358
|
builder.order('title asc')
|
|
359
359
|
builder.order('publishedOn desc') // Override
|
|
360
360
|
builder.slice(0, 10)
|
|
361
|
-
builder.slice(5,
|
|
361
|
+
builder.slice(5, 10) // Override
|
|
362
362
|
const result = builder.build()
|
|
363
363
|
expect(result).toContain('*[_type == "course"]')
|
|
364
364
|
expect(result).toContain('| order(publishedOn desc)')
|
|
@@ -418,7 +418,7 @@ describe('Sanity Query Builder', () => {
|
|
|
418
418
|
.and('published == true')
|
|
419
419
|
.select('_id', 'title', '_type', 'brand')
|
|
420
420
|
.order('_score desc')
|
|
421
|
-
.slice(20,
|
|
421
|
+
.slice(20, 20)
|
|
422
422
|
.build()
|
|
423
423
|
expect(result).toContain('title match "*jazz*"')
|
|
424
424
|
expect(result).toContain('[20...40]')
|