|
- 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} | ${'one hundred'}
- ${2} | ${'two hundred'}
- ${3} | ${'three hundred'}
- ${4} | ${'four hundred'}
- ${5} | ${'five hundred'}
- ${6} | ${'six hundred'}
- ${7} | ${'seven hundred'}
- ${8} | ${'eight hundred'}
- ${9} | ${'nine hundred'}
- `('on $hundreds in hundreds place', ({ hundreds, hundredsName, }) => {
- it(`should return "${hundredsName}" on ${hundreds}00`, () => {
- expect(getThousandName(hundreds, 0, 0)).toBe(hundredsName)
- })
- })
|