Skip to content

Commit

Permalink
Added: broken test.
Browse files Browse the repository at this point in the history
This broken test was added thanks to @nanaya as reported in #64.
  • Loading branch information
rmariuzzo committed Dec 22, 2017
1 parent cbafaa5 commit 99b54b2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/spec/lang_choice_spec.js
Expand Up @@ -89,4 +89,17 @@ describe('The lang.choice() method', function () {
expect(lang.choice('messages.home', 1, {}, 'es')).toBe('Inicio');
});

it('should return the expected message using the fallback language', function() {
lang.setMessages({
'en.test': {
'box': ':count box|:count boxes'
}
});
lang.setFallback('en');
lang.setLocale('pl');
expect(lang.choice('test.box', 1)).toBe('1 box');
expect(lang.choice('test.box', 2)).toBe('2 boxes');
expect(lang.choice('test.box', 10)).toBe('10 boxes');
});

});

0 comments on commit 99b54b2

Please sign in to comment.