forked from eatvio/eatvio_app
fix: test fixed
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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', () {
|
||||
|
||||
Reference in New Issue
Block a user