maxgui/src/components/common/Parameters/__tests__/ParameterInput.spec.js
/**
 * When mandatory attribute of a parameter is true and the input value is invalid, it should renders errorMessage
 * @param {Object} wrapper A Wrapper is an object that contains a mounted component and methods to test the component
 * @param {Object} item a parameter object must contains at least id, value and type attributes
 * @param {String} errorMessage a specific error message
 */
When mandatory attribute of a parameter is true and the input value is invalid, it should renders errorMessage
@param {Object} wrapper A Wrapper is an object that contains a mounted component and methods to test the component
@param {Object} item a parameter object must contains at least id, value and type attributes
@param {String} errorMessage a specific error message
When mandatory attribute of a parameter is true and the input value is invalid it should renders errorMessage @param { Object } wrapper A Wrapper is an object that contains a mounted component and methods to test the component @param { Object } item a parameter object must contains at least id value and type attributes @param { String } errorMessage a specific error message
async function requiredVTextField(wrapper, item, errorMessage) {
    await wrapper.setProps({
        item: item,
    })
    await wrapper.setData({
        targetItem: {
            ...wrapper.vm.$data.targetItem,
            value: null,
        },
    })
    await wrapper
        .findAll('input')
        .at(0)
        .trigger('input')
    let errorMessageDiv = wrapper.find('.v-messages__message').html()
    expect(errorMessageDiv).to.be.include(errorMessage)
}
async function requiredVTextField ( wrapper , item , errorMessage ) { await wrapper . setProps ( { item : item , } ) await wrapper . setData ( { targetItem : { ... wrapper . vm . $data . targetItem , value : null , } , } ) await wrapper . findAll ( 'input' ) . at ( 0 ) . trigger ( 'input' ) let errorMessageDiv = wrapper . find ( '.v-messages__message' ) . html ( ) expect ( errorMessageDiv ) . to . be . include ( errorMessage ) }
When mandatory attribute of a parameter is true and the input value is invalid, it should renders errorMessage
 @param {Object} wrapper A Wrapper is an object that contains a mounted component and methods to test the component
 @param {Object} item a parameter object must contains at least id, value and type attributes
 @param {String} errorMessage a specific error message
When mandatory attribute of a parameter is true and the input value is invalid it should renders errorMessage @param { Object } wrapper A Wrapper is an object that contains a mounted component and methods to test the component @param { Object } item a parameter object must contains at least id value and type attributes @param { String } errorMessage a specific error message
// mockup null (invalid) input event // Manually trigger input event in v-text-field