forked from wangziqi/gongxue-base
fix(deposits): show student numbers in lookup
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { buildDepositStudentOption } from './deposit-student-option';
|
||||
|
||||
describe('deposit student option', () => {
|
||||
it('uses the student number as the non-sensitive identifier', () => {
|
||||
expect(
|
||||
buildDepositStudentOption({ id: 23, name: '张三', studentNo: 'S2026001' }),
|
||||
).toEqual({
|
||||
value: 23,
|
||||
label: '张三 (S2026001)',
|
||||
});
|
||||
});
|
||||
|
||||
it('falls back to the internal id when the student number is missing', () => {
|
||||
expect(buildDepositStudentOption({ id: 23, name: '张三', studentNo: null })).toEqual({
|
||||
value: 23,
|
||||
label: '张三 (#23)',
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user