mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
add test
This commit is contained in:
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -186,9 +186,7 @@ jobs:
|
||||
run: sudo apt-get update && sudo apt-get install -y fluxbox
|
||||
|
||||
- name: Run XVFB
|
||||
run: |
|
||||
Xvfb :1 -screen 0 1024x768x24 >/dev/null 2>&1 &
|
||||
export DISPLAY=:1.0
|
||||
run: Xvfb :1 -screen 0 1024x768x24 >/dev/null 2>&1 &
|
||||
|
||||
- name: Start Fluxbox
|
||||
run: DISPLAY=:1.0 fluxbox >/dev/null 2>&1 &
|
||||
|
||||
4
.github/workflows/e2e.yml
vendored
4
.github/workflows/e2e.yml
vendored
@@ -141,9 +141,7 @@ jobs:
|
||||
run: sudo apt-get update && sudo apt-get install -y fluxbox
|
||||
|
||||
- name: Run XVFB
|
||||
run: |
|
||||
Xvfb :1 -screen 0 1024x768x24 >/dev/null 2>&1 &
|
||||
export DISPLAY=:1.0
|
||||
run: Xvfb :1 -screen 0 1024x768x24 >/dev/null 2>&1 &
|
||||
|
||||
- name: Start Fluxbox
|
||||
run: DISPLAY=:1.0 fluxbox >/dev/null 2>&1 &
|
||||
|
||||
@@ -3,19 +3,28 @@ import { test } from './fixtures'
|
||||
import { IsMac } from './utils';
|
||||
|
||||
if (!IsMac) {
|
||||
test('Window should not be maximized on first launch', async ({ page, app }) => {
|
||||
test('window should not be maximized on first launch', async ({ page, app }) => {
|
||||
await expect(page.locator('.window-controls .maximize-toggle.maximize')).toHaveCount(1)
|
||||
})
|
||||
|
||||
test('Window should be maximized and icon should change on maximize-toggle click', async ({ page }) => {
|
||||
test('window should be maximized and icon should change on maximize-toggle click', async ({ page }) => {
|
||||
await page.click('.window-controls .maximize-toggle.maximize')
|
||||
|
||||
await expect(page.locator('.window-controls .maximize-toggle.restore')).toHaveCount(1)
|
||||
})
|
||||
|
||||
test('Window should be restored and icon should change on maximize-toggle click', async ({ page }) => {
|
||||
test('window should be restored and icon should change on maximize-toggle click', async ({ page }) => {
|
||||
await page.click('.window-controls .maximize-toggle.restore')
|
||||
|
||||
await expect(page.locator('.window-controls .maximize-toggle.maximize')).toHaveCount(1)
|
||||
})
|
||||
|
||||
test('window controls should be hidden on fullscreen mode', async ({ page }) => {
|
||||
// Keyboard press F11 won't work, probably because it's a chromium shortcut (not a document event)
|
||||
await page.evaluate(`window.document.body.requestFullscreen()`)
|
||||
|
||||
await expect(page.locator('.window-controls')).toHaveCount(0)
|
||||
await page.evaluate(`window.document.exitFullscreen()`)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user