Skip to content

Commit

Permalink
Fix tests on non Mac environments
Browse files Browse the repository at this point in the history
  • Loading branch information
heyman committed Dec 25, 2023
1 parent 0cd26c8 commit 694c370
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/basic-editing.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ test('load heynote', async ({ page }) => {
await page.locator('body').pressSequentially('Hello World!')
await page.locator("body").press("Enter")
//await page.waitForTimeout(100);
await page.locator("body").press("Meta+Enter")
await page.waitForTimeout(500);
await page.locator("body").press(heynotePage.isMac ? "Meta+Enter" : "Ctrl+Enter")
await page.waitForTimeout(100);

expect((await heynotePage.getBlocks()).length).toBe(2)

Expand Down
2 changes: 1 addition & 1 deletion tests/test-utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { test, expect } from '@playwright/test';


export function pageErrorGetter(page) {
let messages = [];
page.on('pageerror', (error) => {
Expand All @@ -14,6 +13,7 @@ export class HeynotePage {
constructor(page) {
this.page = page
this.getErrors = pageErrorGetter(page)
this.isMac = process.platform === "darwin"
}

async goto() {
Expand Down

0 comments on commit 694c370

Please sign in to comment.