javascript - Ember.js: Component attribute not reset while testing -
i attempting acceptance test on nested route, makes use of same component twice, different arguments. works fine when run normally, run acceptance test, notice component's arguments aren't being updated, causes test fail. here sample code:
in index.hbs
have:
{{index-view model=model type='location'}}
my index-view
component looks this:
<h1>{{title}} list</h1> {{listing-table model=model type=type}}
by clicking on element in listing-table
, go locations.show
route, contains link-to
locations.show.devices
route. locations.show.devices
route contains:
{{listing-table model=model.devices type='device' exclude='locationname'}}
however, in acceptance tests, can see (by echoing out these attributes in component's javascript) while model
, type
being updated, exclude
set whatever set when component called.
now, have checked (via console.log()
) whether component being reused or not, , see both init ()
, diddestroyelement ()
called twice, means component goes through entire lifecycle twice. however, can't understand why exclude
argument not being updated @ all, , why happen while acceptance testing?
this stripped down version of i'm doing (of course works on twiddle, not in real life!).
{{listing-table model=model.devices type='device' exclude='locationname'}}
you pass value "locationname"
( string ) not link property .locationname
of component . ( i'm quotes around locationname
)
you know, yes?
Comments
Post a Comment