【发布时间】:2016-10-10 20:05:47
【问题描述】:
由于我没有使用纯 Bootstrap 模态,我一直无法弄清楚如何对在页面加载时打开的模态进行单元测试。这是有问题的模态:
{{#bs-modal class="startModal" footer=false open=openModal title="Start Game" closedAction="closeModal" backdropClose=false closeButton=false}}
//modal content
{{/bs-modal}}
我尝试添加一个 startModal 类,希望通过我的单元测试中的 find 以某种方式捕获它
游戏测试.js
test('Initial modal shows up', function(assert) {
visit('/');
andThen(function () {
assert.equal(find('.startModal').length, 1);
});
});
这个测试通过了,但它并不是我真正想要的。我需要断言模态实际上是显示的,而不仅仅是存在的。
【问题讨论】:
标签: unit-testing ember.js ember-qunit ember-testing