事件的角度分量测试

时间:2014-10-06 20:50:56

标签: dart angular-dart dart-unittest

我有一个自定义组件并尝试测试发出的事件

我的组件如下所示:

@Component(
  selector: "my-component",
  templateUrl: 'component/my-component.html',
  useShadowDom: false,
  publishAs: "ctrl"
)

class MyComponent implements ScopeAware {
  Scope scope;

  String value = "foo"

  void onButtonClick(){
    scope.emit('on-select', value);
  }
}

单击按钮时,组件会发出“on-select”事件。像预期的那样工作,但由于我是测试的忠实粉丝,我想测试那个事件。

这是否可以角度0.14.0?

我像angulardart-sample-app

中的测试一样编写测试

整个组件测试确实有很多样板,所以其他一切都很有趣。在0.14.0或未来,是否有更简单的组件测试方法?

0 个答案:

没有答案