Enable automatic browsing upvotes
This commit is contained in:
1 parent
27012399ec
commit
7bf1aa9d24
26 files changed
+339
-57
No files matched your search
@@ -353,6 +353,19 @@ describe('RedditCommentClient.postComment', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('RedditCommentClient.upvote', () => {
|
||||
it('submits the selected fullname through Reddit’s vote endpoint', async () => {
|
||||
const transport = fakeTransport({ post: () => ({ status: 200, body: JSON.stringify({ json: { errors: [] } }) }) });
|
||||
const client = new RedditCommentClient(transport, createMockLogger());
|
||||
|
||||
await expect(client.upvote('t1_comment')).resolves.toEqual({ status: 'submitted' });
|
||||
expect(transport.posts[0]).toMatchObject({
|
||||
url: 'https://old.reddit.com/api/vote',
|
||||
form: { id: 't1_comment', dir: '1', api_type: 'json', uh: 'abc123' },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('RedditCommentClient.fetchCommentStates', () => {
|
||||
const logger = createMockLogger();
|
||||
|
||||
|
||||
Reference in new issue
Block a user