it('adds the word class for the number of child fields', () => { const children = _.times(_.random(1, 16), (i) => <FormField key={i} />) const className = `${numberToWord(children.length)} fields` shallow(<FormFields evenlyDivided>{children}</FormFields>) .should.have.className(className) })
_.each(_.range(1, 17), n => { shallow(<Form.Field width={n} />) .should.have.className(`${numberToWord(n)} wide`) })
it('returns an empty string for null', () => { numberToWord(null).should.equal('') })
it('returns an empty string for boolean inputs', () => { numberToWord(true).should.equal('') numberToWord(false).should.equal('') })
words.forEach(word => numberToWord(word).should.equal(word))
_.times(16, n => numberToWord(n + 1).should.equal(words[n]))