Add Activepieces integration for workflow automation
- Add Activepieces fork with SmoothSchedule custom piece - Create integrations app with Activepieces service layer - Add embed token endpoint for iframe integration - Create Automations page with embedded workflow builder - Add sidebar visibility fix for embed mode - Add list inactive customers endpoint to Public API - Include SmoothSchedule triggers: event created/updated/cancelled - Include SmoothSchedule actions: create/update/cancel events, list resources/services/customers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
import { FastifyInstance } from 'fastify'
|
||||
import { StatusCodes } from 'http-status-codes'
|
||||
import { initializeDatabase } from '../../../../src/app/database'
|
||||
import { databaseConnection } from '../../../../src/app/database/database-connection'
|
||||
import { setupServer } from '../../../../src/app/server'
|
||||
|
||||
let app: FastifyInstance | null = null
|
||||
|
||||
beforeAll(async () => {
|
||||
await initializeDatabase({ runMigrations: false })
|
||||
app = await setupServer()
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
await databaseConnection().destroy()
|
||||
await app?.close()
|
||||
})
|
||||
|
||||
describe('AppSumo API', () => {
|
||||
describe('Action endpoint', () => {
|
||||
it('Activates new accounts', async () => {
|
||||
// arrange
|
||||
const mockEmail = 'mock-email'
|
||||
|
||||
const requestBody = {
|
||||
action: 'activate',
|
||||
plan_id: 'plan_id',
|
||||
uuid: 'uuid',
|
||||
activation_email: mockEmail,
|
||||
}
|
||||
|
||||
const appSumoToken = 'app-sumo-token'
|
||||
|
||||
// act
|
||||
const response = await app?.inject({
|
||||
method: 'POST',
|
||||
url: '/v1/appsumo/action',
|
||||
headers: {
|
||||
authorization: `Bearer ${appSumoToken}`,
|
||||
},
|
||||
body: requestBody,
|
||||
})
|
||||
|
||||
// assert
|
||||
const responseBody = response?.json()
|
||||
expect(response?.statusCode).toBe(StatusCodes.CREATED)
|
||||
expect(responseBody?.message).toBe('success')
|
||||
expect(responseBody?.redirect_url).toBe(
|
||||
`https://cloud.activepieces.com/sign-up?email=${mockEmail}`,
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user