Profile redesign: Timeline filters (#37626)

This commit is contained in:
Echo authored and GitHub committed 2026-01-28 10:17:32 +00:00
1 parent 3f46034039
commit ec76288dff
13 files changed
+704 -5

No files matched your search

@@ -0,0 +1,60 @@
import { parseTimelineKey, timelineKey } from './timelines_typed';
describe('timelineKey', () => {
test('returns expected key for account timeline with filters', () => {
const key = timelineKey({
type: 'account',
userId: '123',
replies: true,
boosts: false,
media: true,
});
expect(key).toBe('account:123:0110');
});
test('returns expected key for account timeline with tag', () => {
const key = timelineKey({
type: 'account',
userId: '456',
tagged: 'nature',
replies: true,
});
expect(key).toBe('account:456:0100:nature');
});
test('returns expected key for account timeline with pins', () => {
const key = timelineKey({
type: 'account',
userId: '789',
pinned: true,
});
expect(key).toBe('account:789:0001');
});
});
describe('parseTimelineKey', () => {
test('parses account timeline key with filters correctly', () => {
const params = parseTimelineKey('account:123:1010');
expect(params).toEqual({
type: 'account',
userId: '123',
boosts: true,
replies: false,
media: true,
pinned: false,
});
});
test('parses account timeline key with tag correctly', () => {
const params = parseTimelineKey('account:456:0100:nature');
expect(params).toEqual({
type: 'account',
userId: '456',
replies: true,
boosts: false,
media: false,
pinned: false,
tagged: 'nature',
});
});
});