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:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user