yabab-dev / ng2-ckeditor

Angular2 CKEditor component
MIT License
358 stars 96 forks source link

Unit Testing with Module #66

Open thePunderWoman opened 7 years ago

thePunderWoman commented 7 years ago

I'm using the current latest Angular CLI (1.0.0-beta.24), and trying to test any code that has ng2-ckeditor in it is proving challenging. Angular 2 switched to webpack, and that's making things interesting. I've included the generic typing for ckeditor as declare var ckeditor: any;, and I've added a reference to ckeditor via the test bootstrap file. However since ckeditor looks for /config.js as well as the theme, it blows up in some instances.

Any test that may interact with the ckeditor instance throws the dreaded 'cannot set property 'dir' of undefined' since I cannot set the config. Any solutions for writing unit tests for components that include this module would be helpful.

yabab-dev commented 7 years ago

I don't know if its possible, this repo is just a wrapper for CKEditor (which have it's own unit tests chain : http://docs.ckeditor.com/#!/guide/dev_tests)

If someone have a solution, i'll take it !