coderly / teamplaybook-ember

0 stars 0 forks source link

Content editor error handling and major refactoring #34

Closed begedin closed 9 years ago

begedin commented 9 years ago

Asana tasks

This PR adds basic error/promise rejection handling to various cases of image uploads.

More importantly, it also heavily refactors the way medium-editor is integrated as a component into the app. It almost completely decouples the 3 medium editor extensions we had to implement from the actual app behavior, to facilitate later removal of medium-editor. All of this refactoring solves some testing issues and addresses the problems in the related Asana task.

It also changes how some promise chains are resolved and allows us to more easily write integration tests for pages, which resolves the related Asana task

Further, I added unit test coverage for extractError,ImageHandlerandImageUploader` libraries. The first library was modified in this PR, so I took the opportunity to cover it with unit tests entirely. The other two are completely related to image insertion into the editor, so the above refactors allowed us to actually cover them with unit tests in the first place.

Merging this requires #33 to be merged first and resolves most of the minor issues we currently have in #33.

I would also like to add unit test coverage for the content-editor component, as possible as that is. However, since it's a large changeset already, I wouldn't mind merging this first and then covering the component with tests as part of a separate task. I'm marking as "awaiting review" because of that.