maxgui/src/components/common/Parameters/__tests__/ParameterInput.spec.js
/**
 * on-input-change should be fired and returned expected value for count, int, duration or size type
 * @param {Object} wrapper A Wrapper is an object that contains a mounted component and methods to test the component
 * @param {String} newValueType  js types: number, boolean, string, ...
 * @param {Number} newValue number
 */
on-input-change should be fired and returned expected value for count, int, duration or size type
@param {Object} wrapper A Wrapper is an object that contains a mounted component and methods to test the component
@param {String} newValueType  js types: number, boolean, string,
@param {Number} newValue number
on - input - change should be fired and returned expected value for count int duration or size type @param { Object } wrapper A Wrapper is an object that contains a mounted component and methods to test the component @param { String } newValueType js types : number boolean string @param { Number } newValue number
async function testReturnNumberValue(wrapper, item, newValueType, newValue) {
    await wrapper.setProps({
        item: item,
    })
    let count = 0
    wrapper.vm.$on('on-input-change', (newItem, changed) => {
        count++
        let chosenSuffix = wrapper.vm.$data.chosenSuffix
        expect(newItem.value).to.be.a(chosenSuffix ? `string` : newValueType)
        expect(newItem.value).to.be.equal(chosenSuffix ? `${newValue}${chosenSuffix}` : newValue)
        expect(changed).to.be.equal(true)
    })
    await wrapper.setData({
        targetItem: {
            ...wrapper.vm.$data.targetItem,
            value: newValue,
        },
    })
    await wrapper
        .findAll('input')
        .at(0)
        .trigger('input')
    expect(count).to.be.equal(1)
}
async function testReturnNumberValue ( wrapper , item , newValueType , newValue ) { await wrapper . setProps ( { item : item , } ) let count = 0 wrapper . vm . $on ( 'on-input-change' , ( newItem , changed ) => { count ++ let chosenSuffix = wrapper . vm . $data . chosenSuffix expect ( newItem . value ) . to . be . a ( chosenSuffix ? ` ` : newValueType ) expect ( newItem . value ) . to . be . equal ( chosenSuffix ? ` ${ newValue } ${ chosenSuffix } ` : newValue ) expect ( changed ) . to . be . equal ( true ) } ) await wrapper . setData ( { targetItem : { ... wrapper . vm . $data . targetItem , value : newValue , } , } ) await wrapper . findAll ( 'input' ) . at ( 0 ) . trigger ( 'input' ) expect ( count ) . to . be . equal ( 1 ) }
on-input-change should be fired and returned expected value for count, int, duration or size type
 @param {Object} wrapper A Wrapper is an object that contains a mounted component and methods to test the component
 @param {String} newValueType  js types: number, boolean, string, ...
 @param {Number} newValue number
on - input - change should be fired and returned expected value for count int duration or size type @param { Object } wrapper A Wrapper is an object that contains a mounted component and methods to test the component @param { String } newValueType js types : number boolean string ... @param { Number } newValue number
// original item // Manually trigger input event in v-text-field