|
- import getHundredName from './getHundredName'
-
- it('should exist', () => {
- expect(getHundredName).toBeDefined()
- })
-
- it('should be a callable', () => {
- expect(typeof getHundredName).toBe('function')
- })
-
- it('should accept 2 arguments', () => {
- expect(getHundredName).toHaveLength(2)
- })
-
- describe('on 0 in tens place', () => {
- test.each`
- ones | onesName
- ${0} | ${'sero'}
- ${1} | ${'isa'}
- ${2} | ${'dalawa'}
- ${3} | ${'tatlo'}
- ${4} | ${'apat'}
- ${5} | ${'lima'}
- ${6} | ${'anim'}
- ${7} | ${'pito'}
- ${8} | ${'walo'}
- ${9} | ${'siyam'}
- `(`should return "$onesName" for $ones`, ({ ones, onesName, }) => {
- expect(getHundredName(0, ones)).toBe(onesName)
- })
- })
-
- describe.each`
- tens | tensName
- ${2} | ${'dalawampu'}
- ${3} | ${'tatlumpu'}
- ${4} | ${'apatnapu'}
- ${5} | ${'limampu'}
- ${6} | ${'animnapu'}
- ${7} | ${'pitumpu'}
- ${8} | ${'walumpu'}
- ${9} | ${'siyamnapu'}
- `('on $tens in tens place', ({ tens, tensName, }) => {
- test.each`
- ones | onesName
- ${0} | ${''}
- ${1} | ${"'t isa"}
- ${2} | ${"'t dalawa"}
- ${3} | ${"'t tatlo"}
- ${4} | ${"'t apat"}
- ${5} | ${"'t lima"}
- ${6} | ${"'t anim"}
- ${7} | ${"'t pito"}
- ${8} | ${"'t walo"}
- ${9} | ${"'t siyam"}
- `(`should return "${tensName}$onesName" for ${tens}$ones`, ({ ones, onesName, }) => {
- expect(getHundredName(tens, ones)).toBe([
- tensName,
- onesName
- ].join(''))
- })
- })
|