Esempio n. 1
0
 it('should return a formatted date', () => {
   const input = inputFactory.create({name: 'whatever', type: 'date'})
   expect(input.preProcessValue('2016-08-06T06:15:38.864Z')).to.eq('2016-08-06')
   expect(input.preProcessValue('2016-08-31T06:15:38.864Z')).to.eq('2016-08-31')
 })
Esempio n. 2
0
 it('should return a number', () => {
   const input = inputFactory.create({name: 'whatever', type: 'number'})
   expect(input.preProcessValue('1')).to.eq(1)
   expect(input.preProcessValue('1.1')).to.eq(1.1)
 })
Esempio n. 3
0
 expect(() => inputFactory.create({name: 'hello', type: inputType})).not.to.throw(Error)