Skip to content

Commit

Permalink
Adding support tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shech2 committed Dec 28, 2023
1 parent 32457d3 commit cac3390
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion aatp/peerbook_webrtc/admin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,28 @@ test.describe('peerbook administration', () => {
const twr = await getTWRBuffer(page)
expect(twr).toMatch(/Logged in/)
})
test('test the support command', async () => {
test('test the support command', async ({request}) => {
await sleep(100)
await page.keyboard.type('support')
await page.keyboard.press("Enter")
await sleep(100)
const twr = await getTWRBuffer(page)
expect(twr).toMatch(/address:$/)
await page.keyboard.type('[email protected]')
await page.keyboard.press("Enter")
await sleep(100)
await page.keyboard.press("ArrowDown")
await page.keyboard.press("Enter")
await sleep(100)
const twr2 = await getTWRBuffer(page)
expect(twr2).toMatch(/issue:$/)
await page.keyboard.type('test issue')
await page.keyboard.press("Enter")
await sleep(100)
const res = await request.get('http://smtp:8025/api/v2/messages')
const msg = await res.json()
expect(msg.count).toBe(1)
const body = msg.items[0].Content.Body
expect(body).toMatch(/test issue/)
})
})

0 comments on commit cac3390

Please sign in to comment.