mirror of
https://github.com/heyman/heynote.git
synced 2024-11-23 16:33:10 +01:00
Fix broken tests
This commit is contained in:
parent
bc77fa725a
commit
594e23c439
@ -11,11 +11,11 @@ test.beforeEach(async ({ page }) => {
|
||||
|
||||
|
||||
test("test valid JSON detection", async ({ page }) => {
|
||||
page.locator("body").pressSequentially(`
|
||||
await page.locator("body").pressSequentially(`
|
||||
{"test": 1, "key2": "hey!"}
|
||||
`)
|
||||
await page.waitForTimeout(200);
|
||||
expect(await page.locator("css=.status .status-block.lang")).toHaveText("JSON (auto)")
|
||||
await page.waitForTimeout(1000);
|
||||
await expect(page.locator("css=.status .status-block.lang")).toHaveText("JSON (auto)")
|
||||
const block = (await heynotePage.getBlocks())[0]
|
||||
expect(block.language.name).toBe("json")
|
||||
expect(block.language.auto).toBeTruthy()
|
||||
@ -23,7 +23,7 @@ test("test valid JSON detection", async ({ page }) => {
|
||||
|
||||
|
||||
test("python detection", async ({ page }) => {
|
||||
page.locator("body").pressSequentially(`
|
||||
await page.locator("body").pressSequentially(`
|
||||
# import complex math module
|
||||
import cmath
|
||||
|
||||
@ -36,6 +36,6 @@ sol2 = (-b+cmath.sqrt(d))/(2*a)
|
||||
|
||||
print('The solution are {0} and {1}'.format(sol1,sol2))
|
||||
`)
|
||||
await page.waitForTimeout(1000);
|
||||
expect(await page.locator("css=.status .status-block.lang")).toHaveText("Python (auto)")
|
||||
await page.waitForTimeout(3000);
|
||||
await expect(page.locator("css=.status .status-block.lang")).toHaveText("Python (auto)")
|
||||
})
|
||||
|
@ -10,24 +10,25 @@ test.beforeEach(async ({ page }) => {
|
||||
});
|
||||
|
||||
test("test markdown mode", async ({ page }) => {
|
||||
heynotePage.setContent(`
|
||||
await heynotePage.setContent(`
|
||||
∞∞∞markdown
|
||||
# Markdown!
|
||||
|
||||
- [ ] todo
|
||||
- [x] done
|
||||
`)
|
||||
await page.waitForTimeout(200)
|
||||
//await page.locator("body").pressSequentially("test")
|
||||
expect(await page.locator("css=.status .status-block.lang")).toHaveText("Markdown")
|
||||
await expect(page.locator("css=.status .status-block.lang")).toHaveText("Markdown")
|
||||
})
|
||||
|
||||
test("checkbox toggle", async ({ page }) => {
|
||||
heynotePage.setContent(`
|
||||
await heynotePage.setContent(`
|
||||
∞∞∞markdown
|
||||
- [ ] todo
|
||||
`)
|
||||
const checkbox = await page.locator("css=.cm-content input[type=checkbox]")
|
||||
expect(checkbox).toHaveCount(1)
|
||||
await expect(checkbox).toHaveCount(1)
|
||||
await checkbox.click()
|
||||
expect(await heynotePage.getBlockContent(0)).toBe("- [x] todo\n")
|
||||
await checkbox.click()
|
||||
|
Loading…
Reference in New Issue
Block a user