()
| 19 | |
| 20 | // Test direct method API |
| 21 | function testDirectMethodAPI() { |
| 22 | // ✅ Should work - correct direct method syntax |
| 23 | window.op.track('button_clicked', { location: 'header' }); |
| 24 | window.op.identify({ profileId: 'user123', email: 'test@example.com' }); |
| 25 | window.op.screenView('/page', { title: 'Test Page' }); |
| 26 | window.op.screenView({ title: 'Test Page' }); // Overload with just properties |
| 27 | window.op.setGlobalProperties({ version: '1.0.0' }); |
| 28 | window.op.revenue(1000, { currency: 'USD' }); |
| 29 | window.op.pendingRevenue(500, { productId: '123' }); |
| 30 | window.op.flushRevenue(); |
| 31 | window.op.clearRevenue(); |
| 32 | window.op.fetchDeviceId(); |
| 33 | window.op.getDeviceId(); |
| 34 | |
| 35 | // ❌ Should error - wrong arguments for track |
| 36 | // @ts-expect-error - track expects (name: string, properties?: TrackProperties) |
| 37 | window.op.track(123); |
| 38 | |
| 39 | // ❌ Should error - wrong arguments for identify |
| 40 | // @ts-expect-error - identify expects IdentifyPayload |
| 41 | window.op.identify('user123'); |
| 42 | } |
| 43 | |
| 44 | // Test queue property |
| 45 | function testQueueProperty() { |
nothing calls this directly
no test coverage detected