Sha256: d913b26c0a664c87793a1e77eee15ff5c06026db661d6a0e8ffce4b37f6c6c77

Contents?: true

Size: 1.88 KB

Versions: 764

Compression:

Stored size: 1.88 KB

Contents

import React from 'react'
import { render, screen } from '../utilities/test-utils'

import TitleDetail from './_title_detail'

const testId = 'titleDetail'
const className = 'custom-class-name'
const detail = 'Commits data and history'
const title = 'Email Notifications'

const TitleDetailDefault = (props) => (
    <>
        <TitleDetail
            aria={{ label: testId }}
            className={className}
            data={{ testid: testId }}
            detail={detail}
            id={testId}
            title={title}
            {...props}
        />
    </>
)

test('should pass data prop', () => {
    render(<TitleDetailDefault />)
    const kit = screen.getByTestId(testId)
    expect(kit).toBeInTheDocument()
})

test('should pass className prop', () => {
    render(<TitleDetailDefault />)
    const kit = screen.getByTestId(testId)
    expect(kit).toHaveClass(className)
})

test('should pass aria prop', () => {
    render(<TitleDetailDefault />)
    const kit = screen.getByTestId(testId)
    expect(kit).toHaveAttribute('aria-label', testId)
})

test('should pass id prop', () => {
    render(<TitleDetailDefault />)
    const kit = screen.getByTestId(testId)
    expect(kit).toHaveProperty('id', testId)
})

test('should have left align by default', () => {
    render(<TitleDetailDefault />)
    const kit = screen.getByTestId(testId)
    expect(kit).toHaveClass('pb_title_detail_kit_left')
})

test('should pass align prop', () => {
    render(<TitleDetailDefault align="right" />)
    const kit = screen.getByTestId(testId)
    expect(kit).toHaveClass('pb_title_detail_kit_right')
})

test('should render detail', () => {
    render(<TitleDetailDefault />)
    const kit = screen.getByTestId(testId)
    expect(kit).toHaveTextContent(detail)
})

test('should render title', () => {
    render(<TitleDetailDefault />)
    const kit = screen.getByTestId(testId)
    expect(kit).toHaveTextContent(title)
})

Version data entries

764 entries across 764 versions & 1 rubygems

Version Path
playbook_ui-12.26.0.pre.alpha.multiselectfixes797 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0.pre.alpha.multiselectfixes796 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0.pre.alpha.multiselectfixes795 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown794 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.25.0.pre.alpha.play824786 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.25.0.pre.alpha.railsmultilevelimprovements785 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.25.0.pre.alpha.railsmultilevelimprovements780 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.25.0.pre.alpha.PLAY818multilevelrebuild779 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.25.0.pre.alpha.railsmultilevelimprovements776 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.25.0.pre.alpha.PLAY818multilevelrebuild774 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.25.0.pre.alpha.PLAY818multilevelrebuild773 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.25.0.pre.alpha.PLAY818multilevelrebuild770 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.25.0.pre.alpha.play822bolddefaultfortitle3764 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.25.0.pre.alpha.PLAY733DetailKit761 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.25.0.pre.alpha.railsmultilevelimprovements758 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.25.0 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.24.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown756 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.24.0.pre.alpha.play824753 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.24.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown752 app/pb_kits/playbook/pb_title_detail/title_detail.test.js