Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

T/3 #78

Merged
merged 6 commits into from
Mar 3, 2017
Merged

T/3 #78

merged 6 commits into from
Mar 3, 2017

Conversation

f1ames
Copy link
Contributor

@f1ames f1ames commented Mar 2, 2017

Tests: Introduced integration tests for spellchecking. Closes ckeditor/ckeditor5#3034.


Additional information

Those tests covers only cases with spellchecking corrections on a non-styled text. The styled one will be covered in ckeditor/ckeditor5#3073.

plugins: [ Enter, Typing, Paragraph, Undo, Bold, Italic, Heading ],
toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
} )
.then( editor => {
Copy link
Member

Choose a reason for hiding this comment

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

Don't indent these lines.

Try to correct all misspelled words using native spell checking mechanism in the browser.

* Words should be corrected and selection placed after corrected word. _In Safari selection is placed
at the beginning of corrected word.
Copy link
Member

Choose a reason for hiding this comment

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

Missing terminating _?

Copy link
Member

Choose a reason for hiding this comment

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

Also, if this is a bug, you can link to the issue on GH to explain that this is a bug.

it( 'should replace with longer word (collapsed)', ( done ) => {
emulateSpellcheckerInsertText( editor, 0, 12, 12, 'e' );

setTimeout( () => {
Copy link
Member

Choose a reason for hiding this comment

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

Could we avoid using setTimeout()? Perhaps the check can be done on editor.document#changeDone? It'll be more reliable (if the timeout is longer). Also, it'd be good to know that the changes are done immediately.

PS. When using listener to check such a thing there may be issues with the event being fired after the test terminated. This will cause crashing tests in an unpredictable manner. So make sure to use a proper afterEach() with editor destroy. Also, you can secure it by using once().

Copy link
Contributor Author

@f1ames f1ames Mar 3, 2017

Choose a reason for hiding this comment

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

I made use of changesDone event. I used once and then off in afterEach instead of destroying editor every time - c38452a.

@Reinmar
Copy link
Member

Reinmar commented Mar 2, 2017

Very nice tests. I like such mechanisms which let you build many cases quickly and maintain them afterwards.

A general remark – a shorter content of paragraphs would be better because the indexes would be lower :P. Always try to make tests as short as possible but not shorter :D

@Reinmar Reinmar closed this Mar 2, 2017
@Reinmar Reinmar reopened this Mar 2, 2017
@Reinmar Reinmar merged commit a758839 into master Mar 3, 2017
@Reinmar Reinmar deleted the t/3 branch March 3, 2017 14:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle spellchecking, autocorrect and autocompletion
2 participants