bitrix_task_control/tests/deleteOldReports.test.ts

24 lines
971 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { describe, expect, it } from 'vitest';
import { REPORT_PREFIXES } from '../src/core/constants';
import { isHiddenReportSheet } from '../src/core/sheets/reportLifecycle';
const prefixes = Object.values(REPORT_PREFIXES);
describe('isHiddenReportSheet', () => {
it('выбирает скрытый лист, если имя содержит префикс отчёта', () => {
expect(
isHiddenReportSheet('Отчет по просроченным задачам 09.10.2026 12:00', true, prefixes)
).toBe(true);
});
it('оставляет видимый лист с тем же префиксом', () => {
expect(
isHiddenReportSheet('Отчет по просроченным задачам 09.10.2026 13:00', false, prefixes)
).toBe(false);
});
it('не трогает скрытый лист без префикса отчёта', () => {
expect(isHiddenReportSheet('Config', true, prefixes)).toBe(false);
});
});