|
- import getThousandName from './getThousandName'
-
- it('should exist', () => {
- expect(getThousandName).toBeDefined()
- })
-
- it('should be a callable', () => {
- expect(typeof getThousandName).toBe('function')
- })
-
- it('should accept 3 arguments', () => {
- expect(getThousandName).toHaveLength(3)
- })
-
- describe.each`
- hundreds | hundredsName
- ${1} | ${'sandaan'}
- ${2} | ${'dalawandaan'}
- ${3} | ${'tatlongdaan'}
- ${4} | ${'apatnaraan'}
- ${5} | ${'limandaan'}
- ${6} | ${'animnaraan'}
- ${7} | ${'pitongdaan'}
- ${8} | ${'walongdaan'}
- ${9} | ${'siyamnaraan'}
- `('on $hundreds in hundreds place', ({ hundreds, hundredsName, }) => {
- test.each`
- ones | onesName
- ${1} | ${'isa'}
- ${2} | ${'dalawa'}
- ${3} | ${'tatlo'}
- ${4} | ${'apat'}
- ${5} | ${'lima'}
- ${6} | ${'anim'}
- ${7} | ${'pito'}
- ${8} | ${'walo'}
- ${9} | ${'siyam'}
- `(`should return "${hundredsName} at $onesName" on ${hundreds}0$ones`, ({ ones, onesName, }) => {
- expect(getThousandName(hundreds, 0, ones)).toBe(hundredsName + ' at ' + onesName)
- })
- })
|