fix: 同步发起页模板名称

This commit is contained in:
江林铖 2026-07-29 18:52:58 +08:00
parent 1089842e27
commit 30947f013f
2 changed files with 6 additions and 2 deletions

View File

@ -217,9 +217,11 @@ describe('考核调研顶层导航保护', () => {
if (url.includes('/templates?month=2026-07&positionGroupCode=brand_designer')) {
return jsonResponse([{
...templateDefinition,
name: '品牌调性视觉评分(综合主管)',
shortName: '视觉评分',
templateVersionId: 'version-1',
templateOptionKey: 'visual_review:version-1',
templateVariantName: '视觉案例评分',
templateVariantName: '视觉评分(综合主管)',
}])
}
if (url.includes('/departments?purpose=evaluator')) return jsonResponse([])
@ -232,6 +234,8 @@ describe('考核调研顶层导航保护', () => {
expect(await screen.findByText('品牌设计师')).toBeInTheDocument()
expect(screen.queryByRole('combobox', { name: '考核岗位' })).not.toBeInTheDocument()
expect(screen.getByText('已按被考核人的人员分配自动关联,发起时无需选择。')).toBeInTheDocument()
expect(await screen.findByRole('option', { name: '品牌调性视觉评分(综合主管)' })).toBeInTheDocument()
expect(screen.queryByRole('option', { name: '视觉评分(综合主管)' })).not.toBeInTheDocument()
await waitFor(() => expect(global.fetch).toHaveBeenCalledWith(
'/api/performance-survey/templates?month=2026-07&positionGroupCode=brand_designer',
expect.anything(),

View File

@ -3446,7 +3446,7 @@ function CreateSurveyForm({
{templates.length === 0 && <option value="">该岗位暂无可用考核项</option>}
{templates.map((template) => (
<option key={template.templateOptionKey || template.code} value={template.templateOptionKey || template.code}>
{template.templateVariantName || getTemplateDisplayName(template)}
{template.name || template.shortName || template.code}
</option>
))}
</select>