为什么导航测试失败了?

时间:2016-01-15 07:02:20

标签: angularjs angularjs-directive angularjs-scope jasmine karma-jasmine

我使用角度按钮点击从一个页面导航到另一个页面?。我能够导航。但我正在尝试测试那个场景。我收到一个错误。我的代码是 http://plnkr.co/edit/fcBzwfM168iKFOC0hv2W?p=preview

测试用例

public void showPopup(int itemId){
        View view = findViewById(itemId);
        PopupMenu popupMenu = new PopupMenu(getSupportActionBar().getThemedContext(), view);
        popupMenu.setOnMenuItemClickListener(/* drop_down item click listener */);
        popupMenu.getMenuInflater().inflate(R.menu.drop_down_menu, popupMenu.getMenu());
        popupMenu.show();
    }

JSCode

it('should go to state 2', function() {
            scope.moveToSecondPage();
            scope.$apply();

            console.log("---")
            console.log($state1)
            expect($state1.get('state2').views.testView.templateUrl).toBe(view2);
        })

0 个答案:

没有答案