Files
faunosteo/apps/app/tests/unit/editor-plural.test.tsx
T

17 lines
547 B
TypeScript

import { describe, expect, it } from 'vitest'
import { pluralKey } from '@/editor/plural'
describe('pluralKey', () => {
it('treats 0 and 1 as singular in French', () => {
expect(pluralKey('fr', 'k', 0)).toBe('k_one')
expect(pluralKey('fr', 'k', 1)).toBe('k_one')
expect(pluralKey('fr', 'k', 2)).toBe('k_other')
})
it('treats only 1 as singular in English', () => {
expect(pluralKey('en', 'k', 0)).toBe('k_other')
expect(pluralKey('en', 'k', 1)).toBe('k_one')
expect(pluralKey('en', 'k', 2)).toBe('k_other')
})
})