fix(backend): fix tests (#16947)

* fix(backend): shouldHideNoteByTimeのロジックの誤りを修正

* fix tests
This commit is contained in:
かっこかり
2025-12-06 19:32:13 +09:00
committed by GitHub
parent 61f9c148f0
commit 63d2870755
3 changed files with 67 additions and 33 deletions

View File

@@ -20,10 +20,10 @@ export function shouldHideNoteByTime(hiddenBefore: number | null | undefined, cr
// 負の値: 作成からの経過時間(秒)で判定
const elapsedSeconds = (Date.now() - createdAtTime) / 1000;
const hideAfterSeconds = Math.abs(hiddenBefore);
return elapsedSeconds > hideAfterSeconds;
return elapsedSeconds >= hideAfterSeconds;
} else {
// 正の値: 絶対的なタイムスタンプ(秒)で判定
const createdAtSeconds = createdAtTime / 1000;
return createdAtSeconds < hiddenBefore;
return createdAtSeconds <= hiddenBefore;
}
}