All Downloads are FREE. Search and download functionalities are using the official Maven repository.

components.controls.InputSelectTree.InputSelectTreeContainer.test.js Maven / Gradle / Ivy

The newest version!
import React from 'react'
import { mount } from 'enzyme'
import configureMockStore from 'redux-mock-store'
import { Provider } from 'react-redux'

import InputSelectTreeContainer from './InputSelectTreeContainer'

const mockStore = configureMockStore()
const store = mockStore({ alerts: {} })

const setup = (propOverrides = {}) => {
    const props = {
        loading: false,
        value: '',
        disabled: false,
        placeholder: 'test',
        valueFieldId: 'id',
        labelFieldId: 'id',
        filter: 'includes',
        resetOnBlur: false,
        disabledValues: [],
        hasChildrenFieldId: true,
        data: [
            {
                id: '123412',
                parentId: '',
                icon: 'fa fa-square',
                image: 'https://i.stack.imgur.com/2zqqC.jpg',
                hasChildren: true,
            },
            {
                id: '33',
                parentId: '123412',
                icon: 'fa fa-square',
                image: 'https://i.stack.imgur.com/2zqqC.jpg',
                hasChildren: false,
            },
        ],
        ...propOverrides,
    }

    const wrapper = mount(
        
            
        ,
    )

    return {
        props,
        wrapper,
    }
}

describe('', () => {
    it('проверяет создание элемента', () => {
        const { wrapper } = setup()

        expect(wrapper.find('InputSelectTreeContainer').exists()).toBeTruthy()
    })
})




© 2015 - 2024 Weber Informatics LLC | Privacy Policy