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

components.widgets.Form.tests.Fieldset.test.js Maven / Gradle / Ivy

There is a newer version: 7.28.3
Show newest version
import React from 'react'
import { mount } from 'enzyme'
import configureMockStore from 'redux-mock-store'
import { Provider } from 'react-redux'

import Fieldset from '../Fieldset'
import StandardFieldset from '../fieldsets/BlankFieldset'

const mockStore = configureMockStore()

const defaultStateObj = {
    models: {
        resolve: {},
    },
}

const setup = (storeObj, propOverrides = {}) => {
    const props = {
        form: '__form',
        component: StandardFieldset,
        visible: '`id == 2`',
        enabled: '`id == 3`',
        rows: [],
        ...propOverrides,
    }

    const store = mockStore(storeObj || defaultStateObj)

    const wrapper = mount(
        
            
, ) return { props, wrapper, store, } } describe('', () => { it('проверяет создание элемента', () => { const { wrapper } = setup() expect(wrapper.find(StandardFieldset).exists()).toBeTruthy() }) })




© 2015 - 2025 Weber Informatics LLC | Privacy Policy