Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Glimmer, components with {{link-to}} fail unit tests #11150

Closed
wagenet opened this issue May 13, 2015 · 13 comments
Closed

On Glimmer, components with {{link-to}} fail unit tests #11150

wagenet opened this issue May 13, 2015 · 13 comments
Labels
Milestone

Comments

@wagenet
Copy link
Member

wagenet commented May 13, 2015

Make a component with a {{link-to}} in it. Try to unit test it. You'll get a failure due to a missing router. This worked on canary prior to glimmer being merged.

@rwjblue rwjblue added the Bug label May 13, 2015
@rwjblue rwjblue added this to the 1.13.0-beta.1 milestone May 13, 2015
@ghost
Copy link

ghost commented May 13, 2015

I was looking into a similar issue this morning. Although It wasn't complaining about a missing router, instead about a missing template / view.

Specifically https://github.com/emberjs/ember.js/blob/master/packages/ember-routing-views/lib/initializers/link-to-component.js#L8 was never being called.

@rwjblue
Copy link
Member

rwjblue commented May 13, 2015

@bdvholmes - That should be registered automatically for unit tests in ember-qunit@0.3.2, but is not registered in moduleForComponent based integration tests due to the issue I describe in emberjs/ember-test-helpers#46 (comment). The solution is outlined there, but I haven't had time to tackle it yet.

@ghost
Copy link

ghost commented May 14, 2015

@rwjblue 👍 awesome thanks, I'll leave you to the missing router error.

@rwjblue
Copy link
Member

rwjblue commented May 14, 2015

emberjs/ember-test-helpers#49 should address this (will need to verify once merged).

@nathanhammond
Copy link
Member

This does not appear to have solved the issue. Still having the same test failures using 0.4.0 in our app.

@rwjblue
Copy link
Member

rwjblue commented May 19, 2015

Yep, we are closer (the router is available now), but it is not initialized properly. More whack-a-mole to play...

@csantero
Copy link
Contributor

Made a repo demonstrating the issue: https://github.com/csantero/link-to-error-demo

@SirZach
Copy link

SirZach commented Jun 20, 2015

Might be redundant information but I'm seeing similar problems.

not ok 142 PhantomJS 1.9 - component:game-listing: it renders
    ---
        actual: >
            null
        message: >
            Died on test #2     at http://localhost:7357/assets/test-support.js:2615
                at test (http://localhost:7357/assets/test-support.js:1773)
                at http://localhost:7357/assets/webatrice.js:20234
                at http://localhost:7357/assets/vendor.js:150
                at tryFinally (http://localhost:7357/assets/vendor.js:30)
                at http://localhost:7357/assets/vendor.js:156
                at http://localhost:7357/assets/test-loader.js:29
                at http://localhost:7357/assets/test-loader.js:21
                at http://localhost:7357/assets/test-loader.js:40
                at http://localhost:7357/assets/test-support.js:5381: Assertion Failed: HTMLBars error: Could not find component named "-link-to" (no component or template with that name was found)
        Log: >

SirZach added a commit to SirZach/bbbbbbbbbbbbbbb that referenced this issue Jun 20, 2015
@rwjblue
Copy link
Member

rwjblue commented Jun 20, 2015

@SirZach - That error is not the same as the one this issue is dealing with, later versions of ember-qunit should fix that particular error (but will likely trigger the one that this issue is intended to track/fix).

@SirZach
Copy link

SirZach commented Jun 20, 2015

@rwjblue I am indeed getting a different error after upgrading to 0.3.14.

not ok 140 PhantomJS 1.9 - component:game-listing-player: it renders
    ---
        actual: >
            null
        message: >
            Died on test #2     at http://localhost:7357/assets/test-support.js:2852
                at test (http://localhost:7357/assets/test-support.js:1808)
                at http://localhost:7357/assets/webatrice.js:20204
                at http://localhost:7357/assets/vendor.js:150
                at tryFinally (http://localhost:7357/assets/vendor.js:30)
                at http://localhost:7357/assets/vendor.js:156
                at http://localhost:7357/assets/test-loader.js:29
                at http://localhost:7357/assets/test-loader.js:21
                at http://localhost:7357/assets/test-loader.js:40
                at http://localhost:7357/assets/test-support.js:5624: Assertion Failed: Cannot call get with 'targetState' on an undefined object.
        Log: >

@visoft
Copy link

visoft commented Jul 8, 2015

@SirZach Were you able to solve Cannot call get with 'targetState' on an undefined object.? It seems to be related to possibly having link-to in a component because the error goes away when I strip those from my template.

@SirZach
Copy link

SirZach commented Jul 8, 2015

@visoft I haven't tested with the latest ember-1.13.3 yet. I'll try to remember to update when I get a chance to do so.

@nathanhammond
Copy link
Member

This was addressed in #11639 and #11644. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants