Ember.js 验收测试检查输入值
Ember.js acceptance test check inputs' values
我在一个大表单中有很多逻辑,其中输入值相互依赖。我正在尝试测试这些输入的值。
在这种情况下 find("#sales_price").val()
结果为空字符串:
fillIn("#sales_price", 12345);
andThen(function() {
assert.equal(find("#sales_price").val(),123456);
...
在这样的示例中,绑定停止工作并且 find("#sales_price").val()
获取输入的初始值(但不是 12345):
find("#sales_price").val(12345);
andThen(function() {
assert.equal(find("#sales_price").val(),123456);
...
要使绑定生效:
fillIn("#sales_price", 123456);
find("#sales_price").change();
andThen(function() {
assert.equal(find("#sales_price").val(),123456);
...
我在一个大表单中有很多逻辑,其中输入值相互依赖。我正在尝试测试这些输入的值。
在这种情况下 find("#sales_price").val()
结果为空字符串:
fillIn("#sales_price", 12345);
andThen(function() {
assert.equal(find("#sales_price").val(),123456);
...
在这样的示例中,绑定停止工作并且 find("#sales_price").val()
获取输入的初始值(但不是 12345):
find("#sales_price").val(12345);
andThen(function() {
assert.equal(find("#sales_price").val(),123456);
...
要使绑定生效:
fillIn("#sales_price", 123456);
find("#sales_price").change();
andThen(function() {
assert.equal(find("#sales_price").val(),123456);
...