-
Notifications
You must be signed in to change notification settings - Fork 33
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
Extend component to output additional CKEditor events #21
Conversation
Hello @ezintz, From what I can see this errors are caused by the
This error is caused by not stubbing/mocking paste event data. You can see how it is done, for example, in clipboard plugin paste tests. The function to mock event data there is mockPasteEvent. It is not available here so you won't be able to use directly, but it should be enough to mock something like
This is very similar case to the one above. Take a look at clipboard plugin drop tests and
Similar story here, please take a look at The easiest way is to look at |
Hello and thank your for your quick answers, for sure it make sense to pass in a correct event object. I was just duplicating the other test without using my brain. No I have not seen that there is actually an issue for this events to be integrated, we just need them ourselves (; I have been extending the testing tools with exact same logic from the files you have been linking, but without much success. The "dataTransfer error" is gone but replaced by another one. After inspecting the original tests it seems the editable is firing the event, which would work but the spy is not working any more. Any ideas? I believe it belongs to that part where I am trying to access the
Very hard to read the minified version.. would it make sense to add the npm |
Hello 😀, I finally 🙄 fixed all the tests for the events I have been adding. Please let me know if there is anything else is needed. Can't wait to see this happen, so I can change to the current package. 🤭 |
Rebased onto latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ezintz I spent some time refactoring and simplifying unit tests since we don't need all the magic related to mocking drag and drop. So I kept only sufficient stuff to keep it simple.
There is some issue with emulating drop
on Firefox, but since it works (confirmed with manual tests and with other browsers), I just decided to skip this one check for FF. Also as for initial drag/drop test it didn't worked since done()
was called outside async/promised stuff and it was executed (making test pass) before asynchronous execution happened.
I also did some minor rewording here and there.
Overall, great job with this PR! Thank you for contributing once again :tada: :clap: :+1:
Extend component to output additional CKEditor events
Merge commit is db2a8da due to some unpleasant surprise from our GH integration :see_no_evil: |
Hello everyone,
I have been extending the component with a few events CKEditor is aware of. Currently the tests are failing because it seems that some resources are not loaded. I would like to fix this as well, but I am not really sure how and I would appreciate any advice.
Here the test results (please note that I stripped the trace a bit):
CKEditorComponent type="divarea" when component is ready editor event paste should emit component paste
CKEditorComponent type="divarea" when component is ready editor event dragend should emit component dragend
CKEditorComponent type="divarea" when component is ready editor event dragstart should emit component dragstart
CKEditorComponent type="divarea" when component is ready editor event drop should emit component drop
CKEditorComponent type="divarea" when component is ready editor event fileUploadRequest should emit component fileUploadRequest
CKEditorComponent type="divarea" when component is ready editor event fileUploadResponse should emit component fileUploadResponse
CKEditorComponent type="inline" when component is ready editor event paste should emit component paste
CKEditorComponent type="inline" when component is ready editor event dragend should emit component dragend
CKEditorComponent type="inline" when component is ready editor event dragstart should emit component dragstart
CKEditorComponent type="inline" when component is ready editor event drop should emit component drop
CKEditorComponent type="inline" when component is ready editor event fileUploadRequest should emit component fileUploadRequest
CKEditorComponent type="inline" when component is ready editor event fileUploadResponse should emit component fileUploadResponse
Are those errors the reason why they have not been added from beginning?
Closes #7.