mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2025-09-05 17:00:39 +00:00
CLI (#84)
* move to packages * update deps * update deps * actions maintenance * don't use blob * cli * fix default import * use synthetic default imports * remove comment * cli packaging * node 18 guard * packages * build system * testing * test pipeline * pipelines * changelog * version bump * update locales * update deps * update deps * update dependecies
This commit is contained in:
5
test/web/file/files.ts
Normal file
5
test/web/file/files.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export default {
|
||||
PDF: 'test/assets/AES.pdf',
|
||||
Image: 'test/assets/image.jpg',
|
||||
Zip: 'test/assets/Pigeons.zip',
|
||||
}
|
13
test/web/file/multiple.spec.ts
Normal file
13
test/web/file/multiple.spec.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { test } from '@playwright/test'
|
||||
import { checkLinkForDownload, createNote, getFileChecksum } from '../../utils'
|
||||
import Files from './files'
|
||||
|
||||
test.describe('@web', () => {
|
||||
test('multiple', async ({ page }) => {
|
||||
const files = [Files.PDF, Files.Image]
|
||||
const checksums = await Promise.all(files.map(getFileChecksum))
|
||||
const link = await createNote(page, { files, views: 2 })
|
||||
await checkLinkForDownload(page, link, 'image.jpg', checksums[1])
|
||||
await checkLinkForDownload(page, link, 'AES.pdf', checksums[0])
|
||||
})
|
||||
})
|
26
test/web/file/simple.spec.ts
Normal file
26
test/web/file/simple.spec.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { test } from '@playwright/test'
|
||||
import { checkLinkDoesNotExist, checkLinkForDownload, checkLinkForText, createNote, getFileChecksum } from '../../utils'
|
||||
import Files from './files'
|
||||
|
||||
test.describe('@web', () => {
|
||||
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 })
|
||||
await checkLinkForDownload(page, link, 'image.jpg', checksum)
|
||||
})
|
||||
})
|
10
test/web/file/too-big.spec.ts
Normal file
10
test/web/file/too-big.spec.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { test } from '@playwright/test'
|
||||
import { createNote } from '../../utils'
|
||||
import Files from './files'
|
||||
|
||||
test.describe('@web', () => {
|
||||
test.skip('to big zip', async ({ page }) => {
|
||||
const files = [Files.Zip]
|
||||
const link = await createNote(page, { files, error: 'note is to big' })
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user