mirror of
https://github.com/heyman/heynote.git
synced 2025-08-09 22:57:45 +02:00
Fix bug that could cause the cursor to be positioned immediately to the left of the widget (within its margin) making it look like there was a space character in the buffer when there was not. Add tests for math blocks. Fixes #21.
27 lines
666 B
JavaScript
27 lines
666 B
JavaScript
import { test, expect } from "@playwright/test";
|
|
import { HeynotePage } from "./test-utils.js";
|
|
|
|
let heynotePage
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
console.log("beforeEach")
|
|
heynotePage = new HeynotePage(page)
|
|
await heynotePage.goto()
|
|
});
|
|
|
|
test("test math mode", async ({ page }) => {
|
|
await heynotePage.setContent(`
|
|
∞∞∞math
|
|
42*30+77
|
|
`)
|
|
await expect(page.locator("css=.heynote-math-result")).toHaveText("1337")
|
|
})
|
|
|
|
test("test math string result has no quotes", async ({ page }) => {
|
|
await heynotePage.setContent(`
|
|
∞∞∞math
|
|
format(1/3, 3)
|
|
`)
|
|
await expect(page.locator("css=.heynote-math-result")).toHaveText("0.333")
|
|
})
|