ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

v3.6.0-beta.1: redirect causes `visit` test helper to fail

Open buschtoens opened this issue 7 years ago • 6 comments

I have a test case like:

test('visiting `/retirement`', async assert => {
  await visit('/retirement');

  assert.strictEqual(
    currentURL(),
    '/retirement-check',
    'redirects to `/retirement-check`'
  );
});

Prior to v3.6.0-beta.1 (v3.5.0 to be precise) this test worked. Now it fails with a TransitionAborted error. Adding a noop catch clause fixes it:

test('visiting `/retirement`', async assert => {
  await visit('/retirement').catch(() => {});

  assert.strictEqual(
    currentURL(),
    '/retirement-check',
    'redirects to `/retirement-check`'
  );
});

Is this expected behavior? Do we want redirects to bubble up to the visit helper as a TransitionAborted error?

buschtoens avatar Oct 24 '18 21:10 buschtoens

Possibly related https://github.com/emberjs/ember-test-helpers/issues/332

chrisseto avatar Oct 25 '18 17:10 chrisseto

What I find weird, is that it used to work before. But yeah, possibly related. ☺️

buschtoens avatar Oct 25 '18 17:10 buschtoens

Related to https://github.com/emberjs/ember.js/issues/17152...

rwjblue avatar Oct 25 '18 20:10 rwjblue

Looks like the same as #17152.

See https://github.com/wagenet/ember-transition-abort-test which passes on latest and beta, but fails on canary, as visible here: https://travis-ci.com/wagenet/ember-transition-abort-test.

The commit that causes issues is 9b7e0f5, though on the face of it, it should be unobjectionable.

wagenet avatar Oct 25 '18 20:10 wagenet

I submitted https://github.com/emberjs/ember.js/pull/17155 to revert https://github.com/emberjs/ember.js/commit/9b7e0f58542bb3bccbfdbb6cc2da1890b7ee4f06 while we work through some timing issues.

rwjblue avatar Oct 26 '18 14:10 rwjblue

Hmm, the fix above definitely addressed the reproduction that @wagenet shared but I'm not 100% sure it will fix the issue @buschtoens has. The commit that I reverted (https://github.com/emberjs/ember.js/commit/9b7e0f58542bb3bccbfdbb6cc2da1890b7ee4f06) doesn't exist in the current beta branch...

@buschtoens - Can you help us track this down with a reproduction?

rwjblue avatar Oct 29 '18 19:10 rwjblue