|
|
@@ -106,6 +106,42 @@ test('copy/paste url to create an iFrame', async ({ page }) => {
|
|
|
await expect( page.locator('.logseq-tldraw .tl-iframe-container')).toHaveCount(1)
|
|
|
})
|
|
|
|
|
|
+test('copy/paste twitter status url to create a Tweet', async ({ page }) => {
|
|
|
+ const canvas = await page.waitForSelector('.logseq-tldraw')
|
|
|
+ const bounds = (await canvas.boundingBox())!
|
|
|
+
|
|
|
+ await page.keyboard.press('t')
|
|
|
+ await page.mouse.move(bounds.x + 5, bounds.y + 5)
|
|
|
+ await page.mouse.down()
|
|
|
+
|
|
|
+ await page.keyboard.type('https://twitter.com/logseq/status/1605224589046386689')
|
|
|
+ await page.keyboard.press(modKey + '+a')
|
|
|
+ await page.keyboard.press(modKey + '+c')
|
|
|
+ await page.keyboard.press('Escape')
|
|
|
+
|
|
|
+ await page.keyboard.press(modKey + '+v')
|
|
|
+
|
|
|
+ await expect( page.locator('.logseq-tldraw .tl-tweet-container')).toHaveCount(1)
|
|
|
+})
|
|
|
+
|
|
|
+test('copy/paste youtube video url to create a Youtube embed', async ({ page }) => {
|
|
|
+ const canvas = await page.waitForSelector('.logseq-tldraw')
|
|
|
+ const bounds = (await canvas.boundingBox())!
|
|
|
+
|
|
|
+ await page.keyboard.press('t')
|
|
|
+ await page.mouse.move(bounds.x + 5, bounds.y + 5)
|
|
|
+ await page.mouse.down()
|
|
|
+
|
|
|
+ await page.keyboard.type('https://www.youtube.com/watch?v=hz2BacySDXE')
|
|
|
+ await page.keyboard.press(modKey + '+a')
|
|
|
+ await page.keyboard.press(modKey + '+c')
|
|
|
+ await page.keyboard.press('Escape')
|
|
|
+
|
|
|
+ await page.keyboard.press(modKey + '+v')
|
|
|
+
|
|
|
+ await expect( page.locator('.logseq-tldraw .tl-youtube-container')).toHaveCount(1)
|
|
|
+})
|
|
|
+
|
|
|
test('cleanup the shapes', async ({ page }) => {
|
|
|
await page.keyboard.press(`${modKey}+a`)
|
|
|
await page.keyboard.press('Delete')
|