ConusAI vendor v0.1.0-dev.20261027+9b1131fb

This commit is contained in:
ConusAI vendor v0.1.0-dev.20261027+9b1131fb
2026-10-27 18:05:18 +00:00
commit f23f4e535d
159 changed files with 4293 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import { describe, expect, it } from 'vitest'
import { MAX_UPLOAD_BYTES } from '@/entities/file'
import nextConfig from '../next.config'
// The upload form posts to a server action, whose body Next caps at 1 MB unless
// configured (next.config `experimental.serverActions.bodySizeLimit`). The cap must
// admit the largest attachment the app accepts, plus multipart overhead.
function parseLimit(limit: string | number | undefined): number | undefined {
if (typeof limit === 'number') return limit
const match = /^(\d+)mb$/.exec(limit ?? '')
return match ? Number(match[1]) * 1024 * 1024 : undefined
}
describe('next.config server action body limit', () => {
it('admits the largest attachment the app accepts', () => {
const limit = parseLimit(nextConfig.experimental?.serverActions?.bodySizeLimit)
expect(limit).toBeGreaterThanOrEqual(MAX_UPLOAD_BYTES)
})
})