mirror of
https://github.com/heyman/heynote.git
synced 2024-11-21 07:23:14 +01:00
Fix test on linux/windows
Change Playwright reporter when running in Github action Change default emacs meta key to Alt on non Linux and Windows Always set emacsMetaKey to "alt" if not on Mac, since the option is only available on Mac
This commit is contained in:
parent
17091d323c
commit
554e04ea67
@ -1,4 +1,5 @@
|
||||
import Store from "electron-store"
|
||||
import { isMac } from "./detect-platform"
|
||||
|
||||
const isDev = !!process.env.VITE_DEV_SERVER_URL
|
||||
|
||||
@ -50,7 +51,7 @@ const schema = {
|
||||
const defaults = {
|
||||
settings: {
|
||||
keymap: "default",
|
||||
emacsMetaKey: "meta",
|
||||
emacsMetaKey: isMac ? "meta" : "alt",
|
||||
showLineNumberGutter: true,
|
||||
showFoldGutter: true,
|
||||
autoUpdate: true,
|
||||
|
@ -20,7 +20,7 @@ export default defineConfig({
|
||||
/* Opt out of parallel tests on CI. */
|
||||
workers: process.env.CI ? 1 : undefined,
|
||||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
||||
reporter: 'html',
|
||||
reporter: process.env.CI ? [['github'], ['html']] : 'list',
|
||||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
||||
use: {
|
||||
/* Base URL to use in actions like `await page.goto('/')`. */
|
||||
|
@ -13,7 +13,7 @@
|
||||
},
|
||||
emacsMetaKey: {
|
||||
type: String,
|
||||
default: "Meta",
|
||||
default: "alt",
|
||||
},
|
||||
showLineNumberGutter: {
|
||||
type: Boolean,
|
||||
|
@ -60,7 +60,7 @@
|
||||
showLineNumberGutter: this.showLineNumberGutter,
|
||||
showFoldGutter: this.showFoldGutter,
|
||||
keymap: this.keymap,
|
||||
emacsMetaKey: this.metaKey,
|
||||
emacsMetaKey: window.heynote.platform.isMac ? this.metaKey : "alt",
|
||||
allowBetaVersions: this.allowBetaVersions,
|
||||
enableGlobalHotkey: this.enableGlobalHotkey,
|
||||
globalHotkey: this.globalHotkey,
|
||||
|
@ -40,7 +40,7 @@ export class HeynoteEditor {
|
||||
theme="light",
|
||||
saveFunction=null,
|
||||
keymap="default",
|
||||
emacsMetaKey="Meta",
|
||||
emacsMetaKey,
|
||||
showLineNumberGutter=true,
|
||||
showFoldGutter=true,
|
||||
bracketClosing=false,
|
||||
|
@ -17,17 +17,22 @@ test("test emacs copy/pase/cut key bindings", async ({ page, browserName }) => {
|
||||
await page.locator("css=.status-block.settings").click()
|
||||
//await page.locator("css=li.tab-editing").click()
|
||||
await page.locator("css=select.keymap").selectOption("emacs")
|
||||
await page.locator("css=select.metaKey").selectOption("alt")
|
||||
if (heynotePage.isMac) {
|
||||
await page.locator("css=select.metaKey").selectOption("alt")
|
||||
}
|
||||
await page.locator("body").press("Escape")
|
||||
|
||||
await page.locator("body").pressSequentially("test")
|
||||
await page.locator("body").press(heynotePage.isMac ? "Meta+A" : "Control+A")
|
||||
await page.locator("body").press("Control+Space")
|
||||
await page.locator("body").press("Control+A")
|
||||
await page.locator("body").press("Alt+W")
|
||||
expect(await heynotePage.getBlockContent(0)).toBe("test")
|
||||
await page.locator("body").press("Control+Y")
|
||||
expect(await heynotePage.getBlockContent(0)).toBe("testtest")
|
||||
|
||||
await page.locator("body").press(heynotePage.isMac ? "Meta+A" : "Control+A")
|
||||
|
||||
await page.locator("body").press("Control+E")
|
||||
await page.locator("body").press("Control+Space")
|
||||
await page.locator("body").press("Control+A")
|
||||
await page.locator("body").press("Control+W")
|
||||
expect(await heynotePage.getBlockContent(0)).toBe("")
|
||||
await page.locator("body").press("Control+Y")
|
||||
|
@ -61,7 +61,7 @@ const ipcRenderer = new IpcRenderer()
|
||||
let settingsData = localStorage.getItem("settings")
|
||||
let initialSettings = {
|
||||
keymap: "default",
|
||||
emacsMetaKey: "meta",
|
||||
emacsMetaKey: "alt",
|
||||
showLineNumberGutter: true,
|
||||
showFoldGutter: true,
|
||||
bracketClosing: false,
|
||||
|
Loading…
Reference in New Issue
Block a user