Skip to content

Commit 998f482

Browse files
pichflmansona
authored andcommitted
Unskip router_js tests
1 parent ceffca1 commit 998f482

1 file changed

Lines changed: 19 additions & 10 deletions

File tree

packages/router_js/tests/router_test.ts

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import {
2727
transitionTo,
2828
transitionToWithAbort,
2929
trigger,
30-
skip,
3130
} from './test_helpers';
3231

3332
let router: Router<Route>;
@@ -1725,7 +1724,7 @@ scenarios.forEach(function (scenario) {
17251724
});
17261725
});
17271726

1728-
skip('error route events', function (assert) {
1727+
test('error route events', function (assert) {
17291728
map(assert, function (match) {
17301729
match('/').to('index');
17311730
match('/posts', function (match) {
@@ -1822,7 +1821,7 @@ scenarios.forEach(function (scenario) {
18221821
}
18231822
};
18241823

1825-
router
1824+
const transition = router
18261825
.transitionTo('/')
18271826
.then(() => {
18281827
return router.transitionTo('/posts/1');
@@ -1835,6 +1834,8 @@ scenarios.forEach(function (scenario) {
18351834
assert.equal(enteredWillChange, 4);
18361835
assert.equal(enteredDidChange, 2);
18371836
});
1837+
1838+
assert.rejects(transition);
18381839
});
18391840

18401841
test("when transitioning to a new parent and child state, the parent's context should be available to the child's model", function (assert) {
@@ -3452,7 +3453,7 @@ scenarios.forEach(function (scenario) {
34523453
});
34533454
});
34543455

3455-
skip("Errors shouldn't be handled after proceeding to next child route", function (assert) {
3456+
test("Errors shouldn't be handled after proceeding to next child route", function (assert) {
34563457
assert.expect(3);
34573458

34583459
map(assert, function (match) {
@@ -3466,12 +3467,15 @@ scenarios.forEach(function (scenario) {
34663467
articles: createHandler('articles', {
34673468
beforeModel: function () {
34683469
assert.ok(true, 'articles beforeModel was entered');
3469-
return reject('blorg');
3470+
let rejection = reject('blorg');
3471+
assert.rejects(rejection);
3472+
return rejection;
34703473
},
34713474
events: {
34723475
error: function () {
34733476
assert.ok(true, 'error handled in articles');
3474-
router.transitionTo('login');
3477+
let transition = router.transitionTo('login');
3478+
assert.rejects(transition as unknown as Promise<any>);
34753479
},
34763480
},
34773481
}),
@@ -3995,7 +3999,7 @@ scenarios.forEach(function (scenario) {
39953999
});
39964000
});
39974001

3998-
skip('aborted transitions can be saved and later retried asynchronously', function (assert) {
4002+
test('aborted transitions can be saved and later retried asynchronously', function (assert) {
39994003
assert.expect(2);
40004004

40014005
let abortedTransition: Transition;
@@ -4006,7 +4010,9 @@ scenarios.forEach(function (scenario) {
40064010
willTransition: function (transition: Transition) {
40074011
if (shouldPrevent) {
40084012
abortedTransition = transition.abort();
4009-
router.intermediateTransitionTo('loading');
4013+
4014+
const t = router.intermediateTransitionTo('loading');
4015+
assert.rejects(t as unknown as Promise<any>);
40104016
}
40114017
},
40124018
},
@@ -6418,7 +6424,7 @@ scenarios.forEach(function (scenario) {
64186424
assert.equal(projectSetupCount, 2, 'project handler should have been setup twice');
64196425
});
64206426

6421-
skip('synchronous transition errors can be detected synchronously', function (assert) {
6427+
test('synchronous transition errors can be detected synchronously', function (assert) {
64226428
map(assert, function (match) {
64236429
match('/').to('root');
64246430
});
@@ -6427,6 +6433,9 @@ scenarios.forEach(function (scenario) {
64276433
throw new Error('boom!');
64286434
};
64296435

6430-
assert.equal((transitionTo(router, '/').error as Error).message, 'boom!');
6436+
const transition = transitionTo(router, '/');
6437+
6438+
assert.rejects(transition as unknown as Promise<any>);
6439+
assert.equal((transition.error as Error).message, 'boom!');
64316440
});
64326441
});

0 commit comments

Comments
 (0)