-
Notifications
You must be signed in to change notification settings - Fork 48
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
export test helpers for downstream consumers #100
Comments
High-level acceptance test level helpers would also be good (like |
@bantic Do you have any suggestions for workarounds for acceptance testing? I am finding that I need to just skip acceptance tests for anything non-trivial involving ember-mobiledoc-editor for now because I can't seem to be able to interact with the editor at all. I'm not really trying to test specific editor functionality but would like to test overall acceptance scenarios like basic updates to the content, calling the update endpoint, and updating the overall UI with flash notifications, etc. |
@chrisdpeters If you are testing basic scenarios of the form "no-content"->"any-content" and vice versa, modifying the dom in the editor directly should be ok to do, but you may run into some trouble due to the async nature of the code here. I will play around with this a bit and make a specific suggestion. |
@chrisdpeters I think we can actually keep an internal reference to the editor instance in tests, and export a test helper that accesses it and can update the editor...I will make a spike on this tomorrow. |
Usage: ``` // acceptance test import { insertText, run } from '../../helpers/ember-mobiledoc-editor'; test('visit /', function(assert) { visit('/'); andThen(() => { let editorEl = find('.mobiledoc-kit')[0]; return insertText(editorEl, 'here is some text'); /* Or: return run(editorEl, (postEditor) => ...); */ }); andThen(() => { // assert text inserted, etc. }); }); ``` fixes #100
Usage: ``` // acceptance test import { insertText, run } from '../../helpers/ember-mobiledoc-editor'; test('visit /', function(assert) { visit('/'); andThen(() => { let editorEl = find('.mobiledoc-kit')[0]; return insertText(editorEl, 'here is some text'); /* Or: return run(editorEl, (postEditor) => ...); */ }); andThen(() => { // assert text inserted, etc. }); }); ``` fixes #100
…itor helpers (#107) Usage: ``` // acceptance test import { insertText, run } from '../../helpers/ember-mobiledoc-editor'; test('visit /', function(assert) { visit('/'); andThen(() => { let editorEl = find('.mobiledoc-kit')[0]; return insertText(editorEl, 'here is some text'); /* Or: return run(editorEl, (postEditor) => ...); */ }); andThen(() => { // assert text inserted, etc. }); }); ``` fixes #100
For apps that depend on ember-mobiledoc-editor, documenting and exporting test-helpers (like
runLater
andmoveCursorTo
) would make development easier.The text was updated successfully, but these errors were encountered: