Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

btw_tr.js: insert_ref should be able to set the caret immediately #3

Open
lddubeau opened this issue May 7, 2014 · 0 comments
Open

Comments

@lddubeau
Copy link
Member

lddubeau commented May 7, 2014

As of 0.1.2 the following code must be used for the tests to pass:

$(gui_node).one('wed-refresh', function () {
    editor.setGUICaret(
        gui_node,
        _indexOf.call(gui_node.childNodes,
                      $(gui_node).children("._ref_abbr")[0]) + 1);
});

What we'd like is not have to wait for a custom event:

editor.setGUICaret(
    gui_node,
       _indexOf.call(gui_node.childNodes,
                  $(gui_node).children("._ref_abbr")[0]) + 1);

The version of the code without the custom event works fine when using BTW manually. However, it fails when testing with Selenium. There is probably a race condition occurring.

The tests that fail when using the version without the custom event are:

selenium_test/bibliographical_references.feature:16 adding custom text to a reference
selenium_test/bibliographical_references.feature:24 adding custom text to a reference when there is already text

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant