Skip to content

Commit 2e744a6

Browse files
committed
Refactor unit tests to support breaking changes in UI Router 1.0
1 parent 91975db commit 2e744a6

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@
4949
},
5050
"devDependencies": {
5151
"angular-mocks": "1.5.*",
52-
"angular-ui-router": "^0.3.2"
52+
"angular-ui-router": "^1.0.0-beta.3"
5353
}
5454
}

src/navigation/examples/vertical-navigation-router.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
* <li>.tooltip - (string) Tooltip to display for the badge
2525
* <li>.badgeClass: - (string) Additional class(es) to add to the badge container
2626
* </ul>
27+
* <li>.uiSref - (string) Optional Angular UI Router state name. If specified, href must be not defined, and vice versa.
28+
* <li>.uiSrefOptions - (object) Optional object to be passed to Angular UI Router $state.go() function
2729
* </ul>
2830
* @param {function} navigateCallback function(item) Callback method invoked on a navigation item click (one with no submenus)
2931
* @param {function} itemClickCallback function(item) Callback method invoked on an item click
@@ -131,7 +133,8 @@
131133
{
132134
title: "Dashboard",
133135
iconClass: "fa fa-dashboard",
134-
uiSref: "dashboard"
136+
uiSref: "dashboard",
137+
uiSrefOptions: { someKey: 'SomeValue' }
135138
},
136139
{
137140
title: "Dolor",

test/navigation/vertical-navigation.spec.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -713,11 +713,13 @@ describe('Directive: pfVerticalNavigation with ui.router', function () {
713713
$stateProvider.state('state0', {
714714
url: "/state0",
715715
controller: 'Controller0',
716-
controllerAs: 'vm'
716+
controllerAs: 'vm',
717+
template: '<!-- -->'
717718
}).state('state1', {
718719
url: "/state1",
719720
controller: 'Controller1',
720-
controllerAs: 'vm'
721+
controllerAs: 'vm',
722+
template: '<!-- -->'
721723
});
722724
});
723725

@@ -756,7 +758,7 @@ describe('Directive: pfVerticalNavigation with ui.router', function () {
756758
title: "Dashboard",
757759
iconClass: "fa fa-dashboard",
758760
uiSref: 'state1',
759-
uiSrefOptions: 'testing'
761+
uiSrefOptions: {name: "testing"}
760762
},
761763
{
762764
title: "Dolor",
@@ -806,7 +808,7 @@ describe('Directive: pfVerticalNavigation with ui.router', function () {
806808
// Click dashboard item
807809
wellDefinedItem.click();
808810

809-
expect($state.go).toHaveBeenCalledWith('state1','testing');
811+
expect($state.go).toHaveBeenCalledWith('state1',{name: "testing"});
810812

811813
// Checking successful state transition
812814
expect($state.current.name).toBe("state1");

0 commit comments

Comments
 (0)