diff --git a/apps/web/__e2e__/models/context-menu.model.ts b/apps/web/__e2e__/models/context-menu.model.ts index f23e971c2..f54600708 100644 --- a/apps/web/__e2e__/models/context-menu.model.ts +++ b/apps/web/__e2e__/models/context-menu.model.ts @@ -46,7 +46,7 @@ export class ContextMenuModel { } getItem(id: string) { - return this.page.locator(getTestId(`menuitem-${id}`)); + return this.page.locator(getTestId(`menu-button-${id}`)); } async hasItem(id: string) { diff --git a/apps/web/__e2e__/models/note-properties.model.ts b/apps/web/__e2e__/models/note-properties.model.ts index 76ecf1086..049cfda42 100644 --- a/apps/web/__e2e__/models/note-properties.model.ts +++ b/apps/web/__e2e__/models/note-properties.model.ts @@ -200,7 +200,7 @@ export class NotePropertiesModel extends BaseProperties { export class NoteContextMenuModel extends BaseProperties { private readonly menu: ContextMenuModel; constructor(page: Page, noteLocator: Locator) { - super(page, noteLocator, "menuitem"); + super(page, noteLocator, "menu-button"); this.menu = new ContextMenuModel(page); } @@ -209,7 +209,7 @@ export class NoteContextMenuModel extends BaseProperties { await this.menu.clickOnItem("colors"); const state = await new ToggleModel( this.page, - `menuitem-${color}` + `menu-button-${color}` ).isToggled(); await this.close(); return state; @@ -218,7 +218,7 @@ export class NoteContextMenuModel extends BaseProperties { async color(color: string) { await this.open(); await this.menu.clickOnItem("colors"); - await new ToggleModel(this.page, `menuitem-${color}`).on(); + await new ToggleModel(this.page, `menu-button-${color}`).on(); await this.close(); } diff --git a/apps/web/__e2e__/models/notebook-item.model.ts b/apps/web/__e2e__/models/notebook-item.model.ts index 288d2b7eb..eb240f8ac 100644 --- a/apps/web/__e2e__/models/notebook-item.model.ts +++ b/apps/web/__e2e__/models/notebook-item.model.ts @@ -61,17 +61,20 @@ export class NotebookItemModel extends BaseItemModel { async pin() { await this.contextMenu.open(this.locator); - await new ToggleModel(this.page, "menuitem-pin").on(); + await new ToggleModel(this.page, "menu-button-pin").on(); } async unpin() { await this.contextMenu.open(this.locator); - await new ToggleModel(this.page, "menuitem-pin").off(); + await new ToggleModel(this.page, "menu-button-pin").off(); } async isPinned() { await this.contextMenu.open(this.locator); - const state = await new ToggleModel(this.page, "menuitem-pin").isToggled(); + const state = await new ToggleModel( + this.page, + "menu-button-pin" + ).isToggled(); await this.contextMenu.close(); return state; } diff --git a/apps/web/__e2e__/models/toggle.model.ts b/apps/web/__e2e__/models/toggle.model.ts index f96fbebf6..c8d5ce9ee 100644 --- a/apps/web/__e2e__/models/toggle.model.ts +++ b/apps/web/__e2e__/models/toggle.model.ts @@ -50,7 +50,7 @@ export class ToggleModel { } private async waitUntilToggleState(locator: Locator, state: TOGGLE_STATES) { - if (this.id.startsWith("menuitem")) await this.page.waitForTimeout(200); + if (this.id.startsWith("menu-button")) await this.page.waitForTimeout(200); else await this.getToggleState(locator, state).waitFor({ state: "visible" }); } diff --git a/apps/web/__e2e__/notes.test.ts b/apps/web/__e2e__/notes.test.ts index 3d6d8c2fc..af10331a1 100644 --- a/apps/web/__e2e__/notes.test.ts +++ b/apps/web/__e2e__/notes.test.ts @@ -229,7 +229,7 @@ test("add tags to note", async ({ page }) => { }); for (const format of ["html", "txt", "md"] as const) { - test(`export note as ${format}`, async ({ page }) => { + test.only(`export note as ${format}`, async ({ page }) => { const app = new AppModel(page); await app.goto(); const notes = await app.goToNotes(); diff --git a/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-linux.txt b/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-linux.txt index ae5cd952c..c551305be 100644 --- a/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-linux.txt +++ b/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-linux.txt @@ -11,6 +11,8 @@ + + + diff --git a/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-win32.txt b/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-win32.txt new file mode 100644 index 000000000..c551305be --- /dev/null +++ b/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-win32.txt @@ -0,0 +1,163 @@ + + + + + + + Test 1 - Notesnook + + + + + + + + + +

Test 1

+

This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1

+ + diff --git a/apps/web/__e2e__/notes.test.ts-snapshots/export-md-Chromium-win32.txt b/apps/web/__e2e__/notes.test.ts-snapshots/export-md-Chromium-win32.txt new file mode 100644 index 000000000..ef91db9ea --- /dev/null +++ b/apps/web/__e2e__/notes.test.ts-snapshots/export-md-Chromium-win32.txt @@ -0,0 +1,7 @@ +# Test 1 + +This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1 + + +--- + diff --git a/apps/web/__e2e__/notes.test.ts-snapshots/export-txt-Chromium-win32.txt b/apps/web/__e2e__/notes.test.ts-snapshots/export-txt-Chromium-win32.txt new file mode 100644 index 000000000..aa657e922 --- /dev/null +++ b/apps/web/__e2e__/notes.test.ts-snapshots/export-txt-Chromium-win32.txt @@ -0,0 +1,7 @@ +Test 1 +---------- + +This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1 + +---------- +Tags: \ No newline at end of file diff --git a/packages/ui/src/components/menu/index.tsx b/packages/ui/src/components/menu/index.tsx index b7af9cdb0..3c081d826 100644 --- a/packages/ui/src/components/menu/index.tsx +++ b/packages/ui/src/components/menu/index.tsx @@ -159,6 +159,7 @@ function MenuContainer(props: PropsWithChildren) { return ( ) { > {title && (