Fix expired calculation to be 6 months from now instead of setting to June

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 07:39:52 +08:00
parent 905f546227
commit 43283aab95
2 changed files with 14 additions and 1 deletions

View File

@@ -143,4 +143,17 @@ describe('loginStore', () => {
store.setIsLoggedIn(true);
expect(store.isLoggedIn).toBe(true);
});
describe('expired', () => {
it('is approximately 6 months in the future', () => {
const now = new Date();
const sixMonthsLater = new Date(now);
sixMonthsLater.setMonth(sixMonthsLater.getMonth() + 6);
const expiredDate = new Date(store.expired);
// Allow 1 day tolerance
const diffMs = Math.abs(expiredDate.getTime() - sixMonthsLater.getTime());
expect(diffMs).toBeLessThan(24 * 60 * 60 * 1000);
});
});
});