Created
July 3, 2019 15:59
-
-
Save brendancarney/b59a32e159f03c827091a98e075cf547 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { html } from "../../packages/editor/src/utils/htm"; | |
context("Focusing on placeholder", () => { | |
beforeEach(() => { | |
cy.visit("http://localhost:3000/"); | |
}); | |
// We had a bug where trying to change the first line in an empty editor to | |
// a heading would crash the editor. This is because Slate was trying to | |
// resolve the selection before the editor has focus. See `change-block` | |
// plugin for more information. | |
it("should focus correctly on the placeholder when the value is empty", () => { | |
cy.setEditorValue(html` | |
<value> | |
<document> | |
<paragraph></paragraph> | |
</document> | |
</value> | |
`); | |
cy.focusEditor(); | |
cy.getByText("Open Block Toolbar") | |
.click({ force: true }) | |
.getByText("Heading") | |
.click({ force: true }); | |
cy.getByText("Heading 1").should("exist"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment