2022-07-19 19:55:05 +00:00
|
|
|
import { test } from '@playwright/test'
|
|
|
|
import { checkLinkDoesNotExist, checkLinkForDownload, checkLinkForText, createNote, getFileChecksum } from '../utils'
|
|
|
|
import Files from './files'
|
|
|
|
|
|
|
|
test('simple pdf', async ({ page }) => {
|
|
|
|
const files = [Files.PDF]
|
|
|
|
const link = await createNote(page, { files })
|
|
|
|
await checkLinkForText(page, link, 'AES.pdf')
|
|
|
|
await checkLinkDoesNotExist(page, link)
|
|
|
|
})
|
|
|
|
|
|
|
|
test('pdf content', async ({ page }) => {
|
|
|
|
const files = [Files.PDF]
|
|
|
|
const checksum = await getFileChecksum(files[0])
|
|
|
|
const link = await createNote(page, { files })
|
|
|
|
await checkLinkForDownload(page, link, 'AES.pdf', checksum)
|
|
|
|
})
|
|
|
|
|
|
|
|
test('image content', async ({ page }) => {
|
|
|
|
const files = [Files.Image]
|
|
|
|
const checksum = await getFileChecksum(files[0])
|
|
|
|
const link = await createNote(page, { files })
|
2022-11-15 12:05:13 +00:00
|
|
|
await checkLinkForDownload(page, link, 'image.jpg', checksum)
|
2022-07-19 19:55:05 +00:00
|
|
|
})
|