maxgui/tests/unit/utils.js
/**
 * This function mockups the selection of an item. By default, it finds all v-select
 * components and expect to have one v-select only, if selector param is defined, it finds component
 * using selector
 * @param {Object} wrapper A Wrapper is an object that contains a mounted component and methods to test the component
 * @param {String} selector Using class only. e.g. '.class'
 * @param {*} item item to be selected
 */
This function mockups the selection of an item. By default, it finds all v-select
components and expect to have one v-select only, if selector param is defined, it finds component
using selector
@param {Object} wrapper A Wrapper is an object that contains a mounted component and methods to test the component
@param {String} selector Using class only.
This function mockups the selection of an item . By default it finds all v - select components and expect to have one v - select only if selector param is defined it finds component using selector @param { Object } wrapper A Wrapper is an object that contains a mounted component and methods to test the component @param { String } selector Using class only .
async function itemSelectMock(wrapper, item, selector = '') {
    let vSelects
    if (selector) {
        vSelects = wrapper.findAll(selector)
    } else {
        vSelects = wrapper.findAllComponents({ name: 'v-select' })
    }
    expect(vSelects.length).to.be.equal(1)
    await vSelects.at(0).vm.selectItem(item)
}
async function itemSelectMock ( wrapper , item , selector = '' ) { let vSelects if ( selector ) { vSelects = wrapper . findAll ( selector ) } else { vSelects = wrapper . findAllComponents ( { name : 'v-select' } ) } expect ( vSelects . length ) . to . be . equal ( 1 ) await vSelects . at ( 0 ) . vm . selectItem ( item ) }
This function mockups the selection of an item.
This function mockups the selection of an item .