I am using ember-cli-i18n in an ember-cli app..
I have property menuItems which returns..
[{
text: 'leftnav_nonfollower',
route: 'nonFollowers'
}, {
text: 'leftnav_nonfans',
route: 'fans'
}]
In template i use menuItems as ..
{{#each menuItem in navItems}}
<li {{action 'changeRoute' menuItem }} >
<a href="#" class='nav-circle'>
{{t menuItem.text}}
</a>
</li>
{{/each}}
Now instead of looking for translation for leftnav_nonfollower.. the library utility t() is actually instead looking for translation of string menuItem.text.. thus giving error Assertion Failed: Missing translation for key "menuItem.text".
Running into the same problem. I know I can stub the i18n service, but I just want to use it in my component tests.
RépondreSupprimerDid you find a solution?
To answer my own question:
Supprimerdeclare a variable in the test, and
in beforeEach do
this.set('i18n', this.container.lookup('service:i18n'))