qUnit: Twitter Bootstrap modals writing outside of qunit-fixture

﹥>﹥吖頭↗ 提交于 2019-12-05 20:39:02

Bootstrap adds a div at the end of the body to manage the backdrop. It remains after the test execution because it is outside the #qunit-fixture div.

<div class="modal-backdrop fade in"></div>

I don't see any other solution than removing the backdrop using the appropriate option :

$('#error').modal({
    backdrop: false
});

or:

data-backdrop="false"

I don't think it should be a big deal, because you probably want to test your code and not bootstrap's modals effects.

See: http://jsfiddle.net/Jv6cM/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!