PolicyStat / ckeditor-spell-check-plugin-js-dev-edge

User interface enhancements and beta features for http://ckeditor-spellcheck.nanospell.com . This repo is for nanospell developers and trusted partners to modify and fork plugin.js
Other
0 stars 0 forks source link

Fix #44 so events are no longer backwards in tests. #45

Closed caffodian closed 7 years ago

caffodian commented 7 years ago

When working on making things async, the events no longer always directly call each other.

This exposed a bug where because the test helper used to listen for event names had the wrong priority, we were actually listening to things backwards in order to compensate for this.

The correct thing is to have the events in correct order, and fix the priority of the test event listeners so they more accurately reflect reality.

(For example: event A's handler calls event B (all synchronous) which calls event C - if the priorities are such that the plugin code catches the event before the test, you can actually get the events in C, B, A order in the test code. Once this becomes more complex + some of the events are async, it becomes crazy if it's inconsistent.)

caffodian commented 7 years ago

Surprisingly didn't break too many things by doing this.