/**
* @jest-environment jsdom
*/
import React from 'react'
import { it, expect, describe } from '@jest/globals'
import { render } from '@testing-library/react'
import '@testing-library/jest-dom/jest-globals'
import { createOrderedMap } from '@ui-schema/ui-schema/Utils/createMap/createMap'
import { StringRendererDebounced } from './TextFieldDebounced'
import { List } from 'immutable'
import { createValidatorErrors } from '@ui-schema/ui-schema'
import { MockSchemaMetaProvider } from '../../../tests/MockSchemaProvider.mock'
describe('StringRendererDebounced', () => {
it('renders html', async () => {
const {container} = render(
{/* @ts-ignore */}
)
// expect(container.firstChild).toMatchSnapshot()
expect(container.querySelector('.MuiTextField-root') !== null).toBeTruthy()
expect(container.querySelector('.MuiInputLabel-root') !== null).toBeTruthy()
expect(container.querySelector('.MuiInputBase-input') !== null).toBeTruthy()
expect(container.querySelectorAll('.Mui-error').length).toBe(0)
})
it('renders html error', async () => {
const {container} = render(
{/* @ts-ignore */}
)
expect(container.querySelector('.MuiTextField-root') !== null).toBeTruthy()
expect(container.querySelector('.MuiInputLabel-root') !== null).toBeTruthy()
expect(container.querySelector('.MuiInputBase-input') !== null).toBeTruthy()
expect(container.querySelectorAll('.Mui-error').length > 0).toBeTruthy()
})
})