fix: test fixed

This commit is contained in:
misha
2026-10-12 11:19:18 +03:00
parent cb312037b2
commit 98c175df44
2 changed files with 6 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/// Finished and last-day-finished diaries stay editable on the calendar day
/// itself and on the next calendar day. Older finished days stay read-only.
/// Finished diaries stay editable for this many calendar days back from today,
/// including today. Older finished days stay read-only.
const int diaryFinishedEditWindowInDays = 7;
bool canEditDiaryDay({

View File

@@ -21,13 +21,14 @@ void main() {
);
}
test('finished today and yesterday stay editable', () {
test('finished days inside the seven-day window stay editable', () {
expect(canEdit(isDiaryFinished: true, diaryDate: '2026-09-30'), isTrue);
expect(canEdit(isDiaryFinished: true, diaryDate: '2026-09-29'), isTrue);
expect(canEdit(isDiaryFinished: true, diaryDate: '2026-09-23'), isTrue);
});
test('finished days older than yesterday stay read-only', () {
expect(canEdit(isDiaryFinished: true, diaryDate: '2026-09-28'), isFalse);
test('finished days older than the seven-day window stay read-only', () {
expect(canEdit(isDiaryFinished: true, diaryDate: '2026-09-22'), isFalse);
});
test('commented days stay read-only inside the window', () {