Preserve commenter role in outreach targeting
This commit is contained in:
1 parent
12e2dc56f1
commit
5e1fc5def9
11 files changed
+35
-26
No files matched your search
@@ -98,7 +98,7 @@ describe('CandidateQueueRepository', () => {
|
||||
expect(queue.countActive()).toBe(2);
|
||||
});
|
||||
|
||||
it('requeues only unedited commenter preparations from the legacy opener contract', () => {
|
||||
it('rejects active commenter candidates admitted by the legacy role policy', () => {
|
||||
const legacyComment = {
|
||||
...post('comment-legacy', 'alice', 300),
|
||||
targetComment: {
|
||||
@@ -112,7 +112,7 @@ describe('CandidateQueueRepository', () => {
|
||||
targetComment: {
|
||||
body: 'I want that too', permalink: '/r/test/comment-current/c2',
|
||||
sourcePostId: 'source', sourcePostAuthor: 'source-author',
|
||||
expressedGender: 'unknown' as const, confidence: 0.91,
|
||||
expressedGender: 'unknown' as const, confidence: 0.91, classifierVersion: 'recipient-role-v2' as const,
|
||||
},
|
||||
};
|
||||
const editedComment = {
|
||||
@@ -136,13 +136,14 @@ describe('CandidateQueueRepository', () => {
|
||||
}, 1_011);
|
||||
}
|
||||
|
||||
expect(queue.requeueLegacyCommentPreparations(1_020)).toBe(1);
|
||||
expect(queue.rejectLegacyCommentCandidates(1_020)).toBe(2);
|
||||
expect(queue.listActive()).toEqual(expect.arrayContaining([
|
||||
expect.objectContaining({ postId: 'comment-legacy', status: 'discovered', prepared: null }),
|
||||
expect.objectContaining({ postId: 'comment-current', status: 'ready' }),
|
||||
expect.objectContaining({ postId: 'comment-edited', status: 'ready' }),
|
||||
expect.objectContaining({ postId: 'post-author', status: 'ready' }),
|
||||
]));
|
||||
const activeIds = queue.listActive().map((candidate) => candidate.postId);
|
||||
expect(activeIds).not.toContain('comment-legacy');
|
||||
expect(activeIds).not.toContain('comment-edited');
|
||||
});
|
||||
|
||||
it('admits, screens, and sends the newest posts before older higher-priority posts', () => {
|
||||
|
||||
Reference in new issue
Block a user