Files
SubTracker/apps/web/tests/unit/utils/worker-capabilities.test.ts
SmileQWQ 6b45518593 feat: add Cloudflare Worker lite branch implementation
- migrate the lite branch runtime to Cloudflare Worker with D1, KV and optional R2 support

- add worker runtime context, request routing, D1 init guards, bootstrap/reset scripts and wrangler config

- keep the product aligned with the lite plan: MailChannels email, JSON-only Wallos import, no local OCR, remote logo fallback without local disk storage

- restore logo search behavior toward main parity while adapting storage and cache to Worker bindings

- update branding and UI copy for SubTracker Lite, including runtime naming and lite-specific settings/help text

- replace Docker-oriented docs/workflow assets with cf-worker specific CI/deploy workflows and deployment docs

- add regression tests for worker runtime paths, database init, logo search, worker capability helpers and bootstrap script behavior
2026-04-22 01:49:17 +08:00

34 lines
932 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',
kvEnabled: true,
r2Enabled: true,
logoStorageEnabled: true,
wallosImportMode: 'json-only'
}
})
).toBe(true)
})
it('treats missing capabilities as disabled storage', () => {
expect(supportsLogoStorage({})).toBe(false)
expect(
supportsManagedLogoLibrary({
storageCapabilities: {
runtime: 'worker-lite',
kvEnabled: false,
r2Enabled: false,
logoStorageEnabled: false,
wallosImportMode: 'json-only'
}
})
).toBe(false)
})
})