wip
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import { describe, test, expect } from 'vitest'
|
||||
import type { Page } from 'playwright'
|
||||
import { PlaywrightAutomationAdapter } from 'packages/automation/infrastructure/adapters/automation'
|
||||
|
||||
describe('CarsFlow integration', () => {
|
||||
test('adapter emits panel-attached then action-started then action-complete for performAddCar', async () => {
|
||||
const adapter = new PlaywrightAutomationAdapter({})
|
||||
const adapter = new PlaywrightAutomationAdapter({}, undefined, undefined)
|
||||
const received: Array<{ type: string }> = []
|
||||
adapter.onLifecycle?.((e) => {
|
||||
received.push({ type: (e as { type: string }).type })
|
||||
adapter.onLifecycle?.((e: { type: string; actionId?: string; timestamp: number; payload?: any }) => {
|
||||
received.push({ type: e.type })
|
||||
})
|
||||
|
||||
|
||||
// Use mock page fixture: minimal object with required methods
|
||||
const mockPage = {
|
||||
waitForSelector: async () => {},
|
||||
@@ -16,7 +17,7 @@ describe('CarsFlow integration', () => {
|
||||
waitForTimeout: async () => {},
|
||||
click: async () => {},
|
||||
setDefaultTimeout: () => {},
|
||||
}
|
||||
} as unknown as Page
|
||||
|
||||
// call attachPanel which emits panel-attached and then action-started
|
||||
await adapter.attachPanel(mockPage, 'add-car')
|
||||
|
||||
Reference in New Issue
Block a user