Skip to content

Commit efac7e0

Browse files
Merge pull request #355 from lorthirk/supportUiRouter1.0
Refactor unit tests to support breaking changes in UI Router 1.0
2 parents c5961b8 + fe8e08d commit efac7e0

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
@@ -46,6 +46,6 @@
4646
},
4747
"devDependencies": {
4848
"angular-mocks": "1.3.0 - 1.5.*",
49-
"angular-ui-router": "^0.3.2"
49+
"angular-ui-router": "1.0.0-beta.3"
5050
}
5151
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
* <li>.tooltip - (string) Tooltip to display for the badge
2424
* <li>.badgeClass: - (string) Additional class(es) to add to the badge container
2525
* </ul>
26+
* <li>.uiSref - (string) Optional Angular UI Router state name. If specified, href must be not defined, and vice versa.
27+
* <li>.uiSrefOptions - (object) Optional object to be passed to Angular UI Router $state.go() function
2628
* </ul>
2729
* @param {function} navigateCallback function(item) Callback method invoked on a navigation item click (one with no submenus)
2830
* @param {function} itemClickCallback function(item) Callback method invoked on an item click
@@ -121,7 +123,8 @@
121123
{
122124
title: "Dashboard",
123125
iconClass: "fa fa-dashboard",
124-
uiSref: "dashboard"
126+
uiSref: "dashboard",
127+
uiSrefOptions: { someKey: 'SomeValue' }
125128
},
126129
{
127130
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)