Skip to content

Commit ba0e5b8

Browse files
pnvasanthclaude
andcommitted
test(feed): add test for authenticated TIME feed v2
Adds a test to verify that the authenticated feed with TIME ranking uses versionToTimeFeedGenerator which passes order_by: 'date' to the feed service. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent fe683a6 commit ba0e5b8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

__tests__/feeds.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,32 @@ describe('query feed', () => {
10731073
expect(res.data.feed.edges.length).toEqual(1);
10741074
});
10751075

1076+
it('should return feed v2 with TIME ranking', async () => {
1077+
loggedUser = '1';
1078+
nock('http://localhost:6002')
1079+
.post('/config')
1080+
.reply(200, {
1081+
user_id: '1',
1082+
config: {
1083+
providers: {},
1084+
},
1085+
});
1086+
nock('http://localhost:6000')
1087+
.post('/feed.json', (body) => {
1088+
expect(body.order_by).toBe(FeedOrderBy.Date);
1089+
return true;
1090+
})
1091+
.reply(200, {
1092+
data: [{ post_id: 'p1' }, { post_id: 'p4' }],
1093+
cursor: 'b',
1094+
});
1095+
const res = await client.query(QUERY, {
1096+
variables: { ...variables, ranking: Ranking.TIME, version: 20 },
1097+
});
1098+
expect(res.errors).toBeFalsy();
1099+
expect(res.data.feed.edges.length).toEqual(2);
1100+
});
1101+
10761102
it('should return only article posts by default', async () => {
10771103
loggedUser = '1';
10781104
await saveFeedFixtures();

0 commit comments

Comments
 (0)