| 123456789101112131415161718192021 |
- import { readFileSync } from 'fs'
- import { resolve } from 'path'
- // 契约:task.noDeadlineVisible(无截止的一次性任务未完成时常驻任务列表)
- const SVC = resolve(__dirname, '../../../cfc-backend/src/main/java/com/etotem/cfc/service/TaskService.java')
- const source = readFileSync(SVC, 'utf8')
- describe('无截止任务常驻列表', () => {
- test('getTodayTasks 可见性含 deadline IS NULL 分支', () => {
- const start = source.indexOf('public List<Task> getTodayTasks(Long memberId, String dimensionCode)')
- const end = source.indexOf('public List<Task> getTodayTasksByFamily')
- const body = source.slice(start, end)
- expect(body).toMatch(/isNull\(Task::getDeadline\)/)
- })
- test('家庭视角同步含 deadline IS NULL 分支', () => {
- const start = source.indexOf('public List<Task> getTodayTasksByFamily')
- const end = source.indexOf('public List<Task> getTodayTasksByCategory')
- const body = source.slice(start, end)
- expect(body).toMatch(/isNull\(Task::getDeadline\)/)
- })
- })
|