Skip to content

Commit

Permalink
build(deps): bump prosemirror-view from 1.33.1 to 1.33.3 (#294)
Browse files Browse the repository at this point in the history
* build(deps): bump prosemirror-view from 1.33.1 to 1.33.3

Bumps [prosemirror-view](https:/prosemirror/prosemirror-view) from 1.33.1 to 1.33.3.
- [Changelog](https:/ProseMirror/prosemirror-view/blob/master/CHANGELOG.md)
- [Commits](ProseMirror/prosemirror-view@1.33.1...1.33.3)

---
updated-dependencies:
- dependency-name: prosemirror-view
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* test(e2e): properly cleanup state on clearEditor helper

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Giamir Buoncristiani <[email protected]>
  • Loading branch information
dependabot[bot] and giamir authored Mar 27, 2024
1 parent 3ae036f commit 1a289c0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 15 additions & 5 deletions test/e2e-helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Page } from "@playwright/test";
import { StacksEditor } from "../src";

export const editorSelector = ".js-editor";
export const menuSelector = ".js-editor-menu";
Expand Down Expand Up @@ -39,11 +40,14 @@ export async function switchMode(page: Page, mode: Mode): Promise<void> {
}
}

export async function clearEditor(page: Page): Promise<string> {
return await page.$eval(
editorSelector,
(editor: HTMLElement) => (editor.innerText = "")
);
export async function clearEditor(page: Page): Promise<void> {
return page.evaluate(() => {
const view = window.editorInstance.editorView;
const state = view.state;
view.updateState(
state.apply(state.tr.delete(0, state.doc.content.size))
);
});
}

/**
Expand Down Expand Up @@ -105,3 +109,9 @@ export async function tab(
const tabKey = browserName === "webkit" ? "Alt+Tab" : "Tab";
await page.keyboard.press(tabKey);
}

declare global {
interface Window {
editorInstance: StacksEditor;
}
}

0 comments on commit 1a289c0

Please sign in to comment.