Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor section tests #20

Merged
merged 1 commit into from
Jul 16, 2015
Merged

Editor section tests #20

merged 1 commit into from
Jul 16, 2015

Conversation

bantic
Copy link
Collaborator

@bantic bantic commented Jul 14, 2015

Tests that typing enter ("\r\n") in a section breaks it into two, and that selecting text across sections and deleting merges them into one.

Tests pass in:

  • safari
  • phantom
  • chrome
  • FF (will be fixed later)

Ready to merge

let startTextNode = walkDOMUntil(containingStartElement, findTextNode(startText));
let endTextNode = walkDOMUntil(containingEndElement, findTextNode(endText));
if (!startTextNode) { throw new Error(`Could not find textNode containing "${startText}"`); }
if (!endTextNode) { throw new Error(`Could not find textNode containing "${endText}"`); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newlines would be ok :-)

@bantic bantic force-pushed the editor-section-tests branch 2 times, most recently from cf59b72 to a067a4f Compare July 15, 2015 00:46
@bantic
Copy link
Collaborator Author

bantic commented Jul 15, 2015

This is ready to go now. There is still a single failing FF test, but it is due to the way Firefox implements document.execCommand('formatBlock') (it enters <br><br><br class="_moz">), which is intended to go away soon anyway.

@bantic bantic force-pushed the editor-section-tests branch 2 times, most recently from 34e49d1 to b0e28cc Compare July 16, 2015 15:22
 * Tests for typing "\r\n" to create section, deleting sections
 * Refactor selectText to take optional start/end, more deletion tests
 * add helper `skipInPhantom`
 * test that when highlighting bold text, the bold button is active
 * Do not turn stickyToolbar on by default (this breaks Phantom tests)
 * remove extra `setTimeout` in mouseup listener
@bantic bantic force-pushed the editor-section-tests branch from b0e28cc to dafdee5 Compare July 16, 2015 15:23
bantic added a commit that referenced this pull request Jul 16, 2015
@bantic bantic merged commit 59610b1 into summertime Jul 16, 2015
@bantic bantic deleted the editor-section-tests branch July 16, 2015 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants