From c204b31cdad1cb8f7e75320d541f6cca06aa48c2 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 14 Aug 2024 19:15:07 +0300 Subject: [PATCH] client: Fix fancytree being broken on mobile --- integration-tests/tree.spec.ts | 18 ++++++++++++++++++ src/views/mobile.ejs | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 integration-tests/tree.spec.ts diff --git a/integration-tests/tree.spec.ts b/integration-tests/tree.spec.ts new file mode 100644 index 000000000..38482eeb0 --- /dev/null +++ b/integration-tests/tree.spec.ts @@ -0,0 +1,18 @@ +import test, { expect } from "@playwright/test"; + +test("Renders on desktop", async ({ page, context }) => { + await page.goto('http://localhost:8082'); + await expect(page.locator('.tree')).toContainText('Trilium Integration Test'); +}); + +test("Renders on mobile", async ({ page, context }) => { + await context.addCookies([ + { + url: "http://localhost:8082", + name: "trilium-device", + value: "mobile" + } + ]); + await page.goto('http://localhost:8082'); + await expect(page.locator('.tree')).toContainText('Trilium Integration Test'); +}); \ No newline at end of file diff --git a/src/views/mobile.ejs b/src/views/mobile.ejs index 218c17d98..dc8471eee 100644 --- a/src/views/mobile.ejs +++ b/src/views/mobile.ejs @@ -128,7 +128,7 @@ - +