import test from 'node:test' import assert from 'node:assert/strict' import { createPresignForm, buildPresignOrderPayload } from './presign/presign-form-state.js' import { buildListParams } from './list-filters.js' import { buildPresignListParams } from './presign/presign-list-model.js' test('new presign submits project while editing retains historical display without rewriting assignment', () => { const fresh = createPresignForm({ projectId: 'p1', projectName: '项目一', teamName: '项目组' }) assert.equal(buildPresignOrderPayload(fresh).projectId, 'p1') const historical = createPresignForm({ ...fresh, id: 'record' }) assert.equal(historical.projectName, '项目一') assert.equal(historical.teamName, '项目组') assert.equal(Object.hasOwn(buildPresignOrderPayload(historical), 'projectId'), false) }) test('project filters reach both mobile list requests', () => { assert.equal(buildListParams('protocol', { source: 'research_donation', projectId: 'p1' }).projectId, 'p1') assert.equal(buildPresignListParams({ projectId: 'p1' }).projectId, 'p1') })