mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-26 03:46:25 -08:00
23 lines
649 B
TypeScript
23 lines
649 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { readPersistedSession } from './sw-session-persistence';
|
|
|
|
describe('readPersistedSession', () => {
|
|
it('keeps older persisted sessions instead of expiring them after one minute', () => {
|
|
const persistedAt = Date.now() - 1000 * 60 * 60 * 6;
|
|
|
|
expect(
|
|
readPersistedSession({
|
|
accessToken: 'token',
|
|
baseUrl: 'https://matrix.example.org',
|
|
userId: '@alice:example.org',
|
|
persistedAt,
|
|
})
|
|
).toEqual({
|
|
accessToken: 'token',
|
|
baseUrl: 'https://matrix.example.org',
|
|
userId: '@alice:example.org',
|
|
persistedAt,
|
|
});
|
|
});
|
|
});
|