mirror of
https://github.com/Smile-QWQ/SubTracker.git
synced 2026-06-03 15:40:27 +08:00
- add tiered D1 caching and cache version invalidation for worker-heavy reads - reduce CPU cost in statistics, calendar, settings, exchange-rate, and import paths - align worker-facing settings and shared types with the no-KV lite runtime
32 lines
881 B
TypeScript
32 lines
881 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { supportsLogoStorage, supportsManagedLogoLibrary } from '@/utils/worker-capabilities'
|
|
|
|
describe('worker capabilities helpers', () => {
|
|
it('detects logo storage from settings capabilities', () => {
|
|
expect(
|
|
supportsLogoStorage({
|
|
storageCapabilities: {
|
|
runtime: 'worker-lite',
|
|
r2Enabled: true,
|
|
logoStorageEnabled: true,
|
|
wallosImportMode: 'json-db-zip'
|
|
}
|
|
})
|
|
).toBe(true)
|
|
})
|
|
|
|
it('treats missing capabilities as disabled storage', () => {
|
|
expect(supportsLogoStorage({})).toBe(false)
|
|
expect(
|
|
supportsManagedLogoLibrary({
|
|
storageCapabilities: {
|
|
runtime: 'worker-lite',
|
|
r2Enabled: false,
|
|
logoStorageEnabled: false,
|
|
wallosImportMode: 'json-db-zip'
|
|
}
|
|
})
|
|
).toBe(false)
|
|
})
|
|
})
|