Files
SubTracker/apps/web/tests/unit/utils/worker-capabilities.test.ts
SmileQWQ 814464bc58 perf: optimize lite caching and worker endpoints
- 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
2026-04-26 20:42:08 +08:00

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)
})
})