openxiangda-cli 2.0.0-alpha.173 → 2.0.0-alpha.174
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@ async function workflowEntryPlatform(page: Page) {
|
|
|
19
19
|
const state = {
|
|
20
20
|
admin: true,
|
|
21
21
|
record: { id: 'record-1', revision: 8, title: '原业务申请', amount: 28600, decision: '已同意', internalNote: '不得显示', systemValue: '内部标识', attachments: [], richText: '<p>原说明</p>' },
|
|
22
|
-
complexFields: false, uploads: [] as any[], childQueries: [] as any[],
|
|
22
|
+
complexFields: false, uploads: [] as any[], childQueries: [] as any[], auditReads: 0,
|
|
23
23
|
children: [
|
|
24
24
|
{ id: 'line-1', revision: 3, purchaseId: 'record-1', sortOrder: 0, name: '原明细甲', quantity: 2, hiddenNote: '不得显示的明细值', detailNote: '保留详情说明' },
|
|
25
25
|
{ id: 'line-2', revision: 4, purchaseId: 'record-1', sortOrder: 1, name: '原明细乙', quantity: 3, hiddenNote: '不得显示的明细值', detailNote: '第二项说明' },
|
|
@@ -74,7 +74,11 @@ async function workflowEntryPlatform(page: Page) {
|
|
|
74
74
|
return ok({ schemaVersion: 'openxiangda.workflow-detail-surface/v2', protocolVersion: 'workflow_detail_surface_v2', detailRevision: 'd'.repeat(64), instanceSequence: 4, timelineRevision: timeline.timelineRevision, surface, timeline,
|
|
75
75
|
currentStatus: { code: 'approved', label: '已同意', tone: 'success' }, nodes: [], handlingRecords: [], operations: [], navigationContext: { desktopReturnPath: '/admin/purchases', mobileReturnPath: '/m/admin/purchases' } });
|
|
76
76
|
}
|
|
77
|
-
if (path.endsWith(`/workflow/instances/${instanceId}/data-audit`))
|
|
77
|
+
if (path.endsWith(`/workflow/instances/${instanceId}/data-audit`)) {
|
|
78
|
+
if (request.headers()['x-openxiangda-csrf-token'] !== 'workflow-entry-csrf') return fail(403, 'WORKFLOW_V2_CSRF_INVALID');
|
|
79
|
+
state.auditReads += 1;
|
|
80
|
+
return ok({ schemaVersion: 'openxiangda.data-audit-page/v2', items: [], total: 0, offset: 0, limit: 50 });
|
|
81
|
+
}
|
|
78
82
|
if (path.endsWith('/native/data/purchase-lines/query')) {
|
|
79
83
|
state.childQueries.push(request.postDataJSON());
|
|
80
84
|
return ok({ schemaVersion: 'openxiangda.data-page/v2', resourceCode: 'purchase-lines', items: state.children, total: state.children.length, offset: 0, limit: 20 });
|
|
@@ -391,6 +395,17 @@ test('supplementary answers are guarded and resume completion without resubmitti
|
|
|
391
395
|
expect(state.launches).toHaveLength(1);
|
|
392
396
|
});
|
|
393
397
|
|
|
398
|
+
test('workflow change history uses the acquired Surface CSRF token', async ({ page }) => {
|
|
399
|
+
const state = await workflowEntryPlatform(page);
|
|
400
|
+
await page.goto('/workflow-entry.e2e.html');
|
|
401
|
+
await page.getByRole('button', { name: '查看', exact: true }).click();
|
|
402
|
+
const detail = page.getByRole('dialog', { name: '申请详情' });
|
|
403
|
+
await detail.getByRole('tab', { name: '变更记录' }).click();
|
|
404
|
+
await expect.poll(() => state.auditReads).toBeGreaterThan(0);
|
|
405
|
+
await expect(detail.getByText('暂无变更记录', { exact: true })).toBeVisible();
|
|
406
|
+
await expect(detail.getByText(/变更记录读取失败/)).toHaveCount(0);
|
|
407
|
+
});
|
|
408
|
+
|
|
394
409
|
test('detail switches to the ordinary full-width editor and back with only one dialog', async ({ page }, testInfo) => {
|
|
395
410
|
const state = await workflowEntryPlatform(page);
|
|
396
411
|
await page.goto('/workflow-entry.e2e.html');
|