feat: expand outreach targeting and messaging
This commit is contained in:
1 parent
7defff422d
commit
d0a8bd0e2f
40 files changed
+890
-82
No files matched your search
@@ -109,3 +109,43 @@ describe('config route conversation kill controls', () => {
|
||||
expect(config.conversations.aiReplyScreening.enabled).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('config route physique targeting', () => {
|
||||
it('hot-updates and persists the image-candidate score range', async () => {
|
||||
const { app, config, saved } = harness();
|
||||
const targetingRef = config.reddit.physiqueTargeting;
|
||||
|
||||
const response = await request(app, '/api/config', {
|
||||
method: 'PUT',
|
||||
headers: { 'content-type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
reddit: {
|
||||
physiqueTargeting: { enabled: true, minScore: 3, maxScore: 7 },
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
expect(response.status).toBe(200);
|
||||
expect(config.reddit.physiqueTargeting).toBe(targetingRef);
|
||||
expect(config.reddit.physiqueTargeting).toEqual({ enabled: true, minScore: 3, maxScore: 7 });
|
||||
expect(saved.at(-1)?.reddit.physiqueTargeting).toEqual({ enabled: true, minScore: 3, maxScore: 7 });
|
||||
});
|
||||
|
||||
it('rejects an inverted physique range without mutating configuration', async () => {
|
||||
const { app, config, saved } = harness();
|
||||
|
||||
const response = await request(app, '/api/config', {
|
||||
method: 'PUT',
|
||||
headers: { 'content-type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
reddit: {
|
||||
physiqueTargeting: { enabled: true, minScore: 8, maxScore: 4 },
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
expect(response.status).toBe(400);
|
||||
expect(config.reddit.physiqueTargeting).toEqual({ enabled: false, minScore: 1, maxScore: 10 });
|
||||
expect(saved).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user