forked from wangziqi/gongxue-base
fix(occupancies): assign room resources during transfers
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import dayjs from 'dayjs';
|
||||
import { buildTransferPayload } from './occupancy-form';
|
||||
|
||||
describe('occupancy transfer form', () => {
|
||||
it('submits the target room resources with the transfer dates', () => {
|
||||
expect(
|
||||
buildTransferPayload({
|
||||
newRoomId: 5,
|
||||
newBedId: 12,
|
||||
newLockerId: 18,
|
||||
transferDate: dayjs('2026-07-13'),
|
||||
oldBillingEndDate: dayjs('2026-07-13'),
|
||||
newBillingStartDate: dayjs('2026-07-14'),
|
||||
reason: '调整宿舍',
|
||||
}),
|
||||
).toEqual({
|
||||
newRoomId: 5,
|
||||
newBedId: 12,
|
||||
newLockerId: 18,
|
||||
transferDate: '2026-07-13',
|
||||
oldBillingEndDate: '2026-07-13',
|
||||
newBillingStartDate: '2026-07-14',
|
||||
reason: '调整宿舍',
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user