0
我开始第一次接受测试我的Ember应用程序。Ember 2,验收测试,websocket等待挂起,然后()等待完成
测试/接受/登录-test.js:
所以我从登录这个开始
import { test } from "qunit";
import moduleForAcceptance from "myapp/tests/helpers/module-for-acceptance";
moduleForAcceptance("Acceptance | login");
test("Should login", function(assert) {
visit("/login");
fillIn("input[type=email]", "[email protected]");
fillIn("input[type=password]", "userpass");
click("button[type=submit]");
andThen(() => {
assert.equal(currentURL(), "/");
assert.equal(find("h1").text(), "Hello!");
});
});
它永不熄灭的andThen()
,所以它挂在click("button[type=submit]");
。
我明白为什么。
在我应用程序/模板/ index.hbs我有一个组件通知它依靠的WebSocket是不断地在我的单页的应用程序挂起(如果我打开Chrome浏览器存在未决的WebSocket调用.. )。
如果我从我的index.hbs中删除此组件,一切都按预期工作。
登录后,我应该告诉andThen()
帮手忽略那个持续处于挂起状态的service('notifications')
的挂起状态?
怎么办?
它应该是'Ember.testing',而不是'Ember.test'。 – TBieniek
已编辑。感谢纠正我:) – Sandeep