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
@@ -13,7 +13,12 @@ import { SettingsRoute } from '../../apps/dashboard/src/features/settings/settin
|
||||
const config = {
|
||||
rateLimit: { minDelayBetweenMessagesMs: 300_000, maxMessagesPerHour: 8, jitterMs: 60_000 },
|
||||
browser: { dryRun: true },
|
||||
reddit: { prioritizeRecentPosts: false, recentWindowMinutes: 60, maxReadyCandidates: 25 },
|
||||
reddit: {
|
||||
prioritizeRecentPosts: false,
|
||||
recentWindowMinutes: 60,
|
||||
maxReadyCandidates: 25,
|
||||
physiqueTargeting: { enabled: false, minScore: 1, maxScore: 10 },
|
||||
},
|
||||
subreddits: [{ name: 'casualconversation', type: 'chat', weight: 2, tone: 'default' }],
|
||||
tones: ['default', 'dominant', 'submissive', 'playful', 'direct', 'gentle', 'kink-friendly', 'teasing'],
|
||||
advanced: { openrouter: { chatModel: 'example/chat-model' } },
|
||||
@@ -204,6 +209,46 @@ describe('settings and access', () => {
|
||||
expect(screen.queryByText('Settings saved.')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('validates and saves the physique targeting range', async () => {
|
||||
installConfigApi();
|
||||
let requestBody: { reddit?: typeof config.reddit } | undefined;
|
||||
server.use(http.put('/api/config', async ({ request }) => {
|
||||
requestBody = await request.json() as typeof requestBody;
|
||||
return HttpResponse.json({
|
||||
success: true,
|
||||
config: {
|
||||
rateLimit: config.rateLimit,
|
||||
browser: config.browser,
|
||||
reddit: requestBody?.reddit ?? config.reddit,
|
||||
},
|
||||
subreddits: config.subreddits,
|
||||
});
|
||||
}));
|
||||
const user = userEvent.setup();
|
||||
renderSettings('/settings?section=monitoring');
|
||||
|
||||
await user.click(await screen.findByRole('checkbox', { name: 'Enable physique targeting' }));
|
||||
const minimum = screen.getByRole('spinbutton', { name: 'Minimum physique score' });
|
||||
const maximum = screen.getByRole('spinbutton', { name: 'Maximum physique score' });
|
||||
await user.clear(minimum);
|
||||
await user.type(minimum, '7');
|
||||
await user.clear(maximum);
|
||||
await user.type(maximum, '4');
|
||||
await user.click(screen.getByRole('button', { name: 'Save settings' }));
|
||||
expect(screen.getByText('Minimum physique score cannot exceed maximum physique score.')).toBeInTheDocument();
|
||||
expect(requestBody).toBeUndefined();
|
||||
|
||||
await user.clear(maximum);
|
||||
await user.type(maximum, '9');
|
||||
await user.click(screen.getByRole('button', { name: 'Save settings' }));
|
||||
|
||||
await waitFor(() => expect(requestBody?.reddit?.physiqueTargeting).toEqual({
|
||||
enabled: true,
|
||||
minScore: 7,
|
||||
maxScore: 9,
|
||||
}));
|
||||
});
|
||||
|
||||
it('validates subreddit rows and confirms disabling dry run before saving behaviour', async () => {
|
||||
installConfigApi();
|
||||
let updateRequests = 0;
|
||||
|
||||
Reference in new issue
Block a user