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

components.widgets.Html.Html.test.js Maven / Gradle / Ivy

The newest version!
import React from 'react'
import { render } from 'enzyme'

import Html from './Html.jsx'

it('correct class in html', () => {
    const wrapper = render(
        name is {name} , surname id {surname}'}
        />,
    )

    expect(wrapper.find('.some')).toHaveLength(1)
    expect(wrapper.text()).toBe('name is {name} , surname id {surname}')
})

it('correct string in html (with placeholders)', () => {
    const wrapper = render(
        ,
    )

    expect(wrapper.text()).toBe('Tom : Sower')
})

it('right html with placeholders', () => {
    const wrapper = render(
        ,
    )

    expect(wrapper.html()).toEqual('

Tom : Sower

') }) it('right html with placeholders and lines break', () => { const wrapper = render( , ) expect(wrapper.html()).toEqual('\n' + 'what is my name\n' + 'Tom Sower\n' + '') })




© 2015 - 2024 Weber Informatics LLC | Privacy Policy