如何使用量角器选择聚合物组件



嗨,以下是我的html

    <div class="ng-scope" ng-app="app" ng-controller="Todos">
<nd-uber-bar class="ng-isolate-scope" title="Title" subtitle="subtitle">
<nd-drawer-panel id="ndDrawerPanel" class="style-scope nd-uber-bar x-scope nd-drawer-panel-0" force-narrow="" disable-swipe="" style="touch-action: auto;" narrow="" selected="drawer">

我想验证Selected ="抽屉",该=使用量角器的聚合物组件

您可以通过获取元素的 selected属性来完成:

var polymerPanel = $('#ndDrawerPanel');
expect(polymerPanel.getAttribute("selected")).toEqual("drawer");

最新更新