cryptgeon/test/cross/text/simple.spec.ts
Nicco d7e5a34b14
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
2023-05-14 13:52:47 +02:00

20 lines
1.1 KiB
TypeScript

import { test } from '@playwright/test'
import { CLI, checkLinkForText, createNote } from '../../utils'
const text = `Endless prejudice endless play derive joy eternal-return selfish burying. Of decieve play pinnacle faith disgust. Spirit reason salvation burying strong of joy ascetic selfish against merciful sea truth. Ubermensch moral prejudice derive chaos mountains ubermensch justice philosophy justice ultimate joy ultimate transvaluation. Virtues convictions war ascetic eternal-return spirit. Ubermensch transvaluation noble revaluation sexuality intentions salvation endless decrepit hope noble fearful. Justice ideal ultimate snare god joy evil sexuality insofar gains oneself ideal.`
test.describe('text @cross', () => {
test('cli to web', async ({ page }) => {
const note = await CLI('send', 'text', text)
const link = note.stdout.trim().replace(/(.|\s)*http/g, 'http')
await checkLinkForText(page, link, text)
})
test('web to cli', async ({ page }) => {
const link = await createNote(page, { text })
const retrieved = await CLI('open', link)
test.expect(retrieved.stdout.trim()).toBe(text)
})
})