diff --git a/test/lib/translate.js b/test/lib/translate.js index 37b9f1a..dd11075 100644 --- a/test/lib/translate.js +++ b/test/lib/translate.js @@ -30,26 +30,26 @@ describe('translate', () => { }); it('should pluralise for none/one/many pluralisation keys', () => { - expect(translate('foo.bar', undefined, { foo: { none: 'none', one: 'one', many: 'many' } }, undefined, 0)).to.equal('none'); - expect(translate('foo.bar', undefined, { foo: { none: 'none', one: 'one', many: 'many' } }, undefined, 1)).to.equal('one'); - expect(translate('foo.bar', undefined, { foo: { none: 'none', one: 'one', many: 'many' } }, undefined, 2)).to.equal('many'); - expect(translate('foo.bar', undefined, { foo: { none: 'none', one: 'one', many: 'many' } }, undefined, 100)).to.equal('many'); + expect(translate('foo.bar', undefined, { foo: { bar: { none: 'none', one: 'one', many: 'many' } } }, undefined, 0)).to.equal('none'); + expect(translate('foo.bar', undefined, { foo: { bar: { none: 'none', one: 'one', many: 'many' } } }, undefined, 1)).to.equal('one'); + expect(translate('foo.bar', undefined, { foo: { bar: { none: 'none', one: 'one', many: 'many' } } }, undefined, 2)).to.equal('many'); + expect(translate('foo.bar', undefined, { foo: { bar: { none: 'none', one: 'one', many: 'many' } } }, undefined, 100)).to.equal('many'); }); it('should pluralise for zero/one/other pluralisation keys', () => { - expect(translate('foo.bar', undefined, { foo: { zero: 'zero', one: 'one', other: 'other' } }, undefined, 0)).to.equal('zero'); - expect(translate('foo.bar', undefined, { foo: { zero: 'zero', one: 'one', other: 'other' } }, undefined, 1)).to.equal('one'); - expect(translate('foo.bar', undefined, { foo: { zero: 'zero', one: 'one', other: 'other' } }, undefined, 2)).to.equal('other'); - expect(translate('foo.bar', undefined, { foo: { zero: 'zero', one: 'one', other: 'other' } }, undefined, 100)).to.equal('other'); + expect(translate('foo.bar', undefined, { foo: { bar: { zero: 'zero', one: 'one', other: 'other' } } }, undefined, 0)).to.equal('zero'); + expect(translate('foo.bar', undefined, { foo: { bar: { zero: 'zero', one: 'one', other: 'other' } } }, undefined, 1)).to.equal('one'); + expect(translate('foo.bar', undefined, { foo: { bar: { zero: 'zero', one: 'one', other: 'other' } } }, undefined, 2)).to.equal('other'); + expect(translate('foo.bar', undefined, { foo: { bar: { zero: 'zero', one: 'one', other: 'other' } } }, undefined, 100)).to.equal('other'); }); it('should pluralise for singular/plural pluralisation keys', () => { // assume 0 is a plural form if using the singular/plural pluralisation convention - expect(translate('foo.bar', undefined, { foo: { singular: 'singular', plural: 'plural' } }, undefined, 0)).to.equal('plural'); + expect(translate('foo.bar', undefined, { foo: { bar: { singular: 'singular', plural: 'plural' } } }, undefined, 0)).to.equal('plural'); - expect(translate('foo.bar', undefined, { foo: { singular: 'singular', plural: 'plural' } }, undefined, 1)).to.equal('singular'); - expect(translate('foo.bar', undefined, { foo: { singular: 'singular', plural: 'plural' } }, undefined, 2)).to.equal('plural'); - expect(translate('foo.bar', undefined, { foo: { singular: 'singular', plural: 'plural' } }, undefined, 100)).to.equal('plural'); + expect(translate('foo.bar', undefined, { foo: { bar: { singular: 'singular', plural: 'plural' } } }, undefined, 1)).to.equal('singular'); + expect(translate('foo.bar', undefined, { foo: { bar: { singular: 'singular', plural: 'plural' } } }, undefined, 2)).to.equal('plural'); + expect(translate('foo.bar', undefined, { foo: { bar: { singular: 'singular', plural: 'plural' } } }, undefined, 100)).to.equal('plural'); });