diff --git a/packages/feedback-client/src/index.test.ts b/packages/feedback-client/src/index.test.ts index fe51cf33..608f8a5b 100644 --- a/packages/feedback-client/src/index.test.ts +++ b/packages/feedback-client/src/index.test.ts @@ -4,7 +4,7 @@ import type { ApiClient } from '@bytelyst/api-client'; describe('FeedbackClient', () => { const mockApi: Partial = { - post: vi.fn(), + fetch: vi.fn(), }; const createClient = () => new FeedbackClient(mockApi as ApiClient); @@ -21,7 +21,7 @@ describe('FeedbackClient', () => { createdAt: new Date().toISOString(), }; - mockApi.post = vi.fn().mockResolvedValue(mockResponse); + mockApi.fetch = vi.fn().mockResolvedValue(mockResponse); const result = await client.submitWithScreenshot({ type: 'bug', @@ -30,10 +30,8 @@ describe('FeedbackClient', () => { }); expect(result).toEqual(mockResponse); - expect(mockApi.post).toHaveBeenCalledWith('/api/feedback', expect.objectContaining({ - type: 'bug', - title: 'Test bug', - body: 'Description', + expect(mockApi.fetch).toHaveBeenCalledWith('/api/feedback', expect.objectContaining({ + method: 'POST', })); }); diff --git a/services/platform-service/src/modules/predictive-analytics/campaign-engine.ts b/services/platform-service/src/modules/predictive-analytics/campaign-engine.ts index 92eb2dac..1bc9be28 100644 --- a/services/platform-service/src/modules/predictive-analytics/campaign-engine.ts +++ b/services/platform-service/src/modules/predictive-analytics/campaign-engine.ts @@ -221,7 +221,7 @@ export class CampaignEngine { if (!(Number(value) < (condition.value as number))) return false; break; case 'eq': - if (value !== condition.value) return false; + if (String(value) !== String(condition.value)) return false; break; case 'in': if (!(condition.value as unknown[]).includes(value)) return false; @@ -416,13 +416,11 @@ export class CampaignEngine { } (bus as any).emit('notifications.inapp.create', { - payload: { - userId: context.userId, - productId: context.productId, - title: 'Personalized for you', - content: 'Based on your interests, check out these features.', - priority: context.riskSegment === 'critical' ? 'high' : 'normal', - }, + userId: context.userId, + productId: context.productId, + title: 'Personalized for you', + content: 'Based on your interests, check out these features.', + priority: context.riskSegment === 'critical' ? 'high' : 'normal', }); return { @@ -479,10 +477,8 @@ export class CampaignEngine { }; (bus as any).emit('integrations.slack.notify', { - payload: { - channel: '#customer-success', - message, - }, + channel: '#customer-success', + message, }); return {