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

Fixed emoji text matching with repeated symbols in a single line #2452

Merged
merged 6 commits into from
Oct 3, 2018

Conversation

jacekbogdanski
Copy link
Member

What is the purpose of this pull request?

Bug fix

Does your PR contain necessary tests?

All patches which change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.

This PR contains

  • Unit tests
  • Manual tests

What changes did you make?

Emoji symbol was incorrectly matched when tested text have duplicated symbols.

Closes #2394

@mlewand mlewand self-requested a review October 3, 2018 11:38
@mlewand mlewand self-assigned this Oct 3, 2018
Copy link
Contributor

@mlewand mlewand left a comment

Choose a reason for hiding this comment

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

Looks that the fix was much simpler than I originally anticipated.

Neat idea with making the tests synchronous!

I found just minor annoyances, I'll correct these in a minute and we're good to go.

@@ -31,6 +31,12 @@

var stub = null;

// Disable autocomplete throttling so the tests can be run synchronously.
var throttle = CKEDITOR.tools.buffers.throttle;
Copy link
Contributor

Choose a reason for hiding this comment

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

If possible try to merge subsequent var statements.

wait();
bot.setHtmlWithSelection( '<p>foo :collision :collision^</p>' );
editor.editable().fire( 'keyup', new CKEDITOR.dom.event( {} ) );
assert.areSame( ':collision', autocomplete.model.query, 'Model keeps wrong querry.' );
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be no dots at the end of assert msg. I can see that you might have take it from other asserts in this suite.

What's interesting is that objectAsserts have correct form 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

typo querry -> query

<h2>Classic editor</h2>
<div id="classic"></div>
<h2>Inline editor</h2>
<div id="inline" contenteditable="true">
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a detail, but since you're closing all of the tags in a single line, it would be nice to close this one as well.

@mlewand mlewand self-requested a review October 3, 2018 14:22
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.

Minimal character count for autocomplete is incorrect if preceded with an unfinished autocomplete match
2 participants