import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import { join } from 'node:path'
import test from 'node:test'

const root = process.cwd()

test('receipt folder asset fetch bypasses stale preview cache', () => {
  const service = readFileSync(join(root, 'web/src/services/receiptFolder.js'), 'utf8')

  assert.match(service, /export function fetchReceiptFolderAsset/)
  assert.match(service, /cache: 'no-store'/)
  assert.match(service, /responseType: 'blob'/)
})
