24 lines
971 B
TypeScript
24 lines
971 B
TypeScript
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);
|
||
});
|
||
});
|