Skip to content

Commit 5092493

Browse files
chore(test): Update tests to account for new State.create() behavior.
1 parent 9769c6a commit 5092493

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

test/resolveSpec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ declare var inject;
66
import Spy = jasmine.Spy;
77
import "./util/matchers";
88
import { resolvedValue, resolvedError, caught } from './util/testUtilsNg1';
9-
import { ResolveContext, State, PathNode, omit, pick, extend, forEach } from "../src/index";
9+
import { ResolveContext, State, PathNode, omit, pick, inherit, forEach } from "ui-router-core";
1010
import { UIRouter, Resolvable, services, StateDeclaration } from "ui-router-core";
1111
import "../src/legacy/resolveService";
1212

@@ -441,11 +441,11 @@ describe("Integration: Resolvables system", () => {
441441
beforeEach(module(function ($stateProvider) {
442442
let copy = {};
443443
forEach(statesMap, (stateDef, name) => {
444-
copy[name] = extend({}, stateDef);
444+
copy[name] = stateDef;
445445
});
446446

447-
angular.forEach(copy, (stateDef: StateDeclaration) => {
448-
if (stateDef.name) $stateProvider.state(stateDef);
447+
angular.forEach(copy, (stateDef: State) => {
448+
if (stateDef.name) $stateProvider.state(stateDef.self);
449449
});
450450
}));
451451

test/stateSpec.js

-5
Original file line numberDiff line numberDiff line change
@@ -1585,11 +1585,6 @@ describe('state', function () {
15851585
expect($state.$current.toString()).toBe('A');
15861586
}));
15871587

1588-
it('should always have a resolve object', inject(function ($state) {
1589-
expect($state.$current.resolve).toBeDefined();
1590-
expect(typeof $state.$current.resolve).toBe('object');
1591-
}));
1592-
15931588
it('should include itself and parent states', inject(function ($state, $q) {
15941589
$state.transitionTo(DD); $q.flush();
15951590
expect($state.$current.includes).toEqual({ '': true, D: true, DD: true });

0 commit comments

Comments
 (0)