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.22.0 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.21.0.pre.alpha.PLAY807RTEcustomtoolbar680 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.21.0 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.20.0.pre.alpha.movemarkdown668 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.20.0.pre.alpha.title2667 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.20.0.pre.alpha.title2665 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.20.0 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.19.0.pre.alpha.PLAY699zindexresponsive650 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.19.0.pre.alpha.movemarkdown639 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.19.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown638 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.19.0.pre.alpha.movemarkdown637 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.18.0.pre.alpha.PLAY785typeaheadts632 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.19.0 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown629 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown628 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.18.0.pre.alpha.play786multilevelselectimprovements627 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown626 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown617 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.18.0.pre.alpha.PLAY735mobileheadersfix616 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.18.0.pre.alpha.play786multilevelselectimprovements613 app/pb_kits/playbook/pb_title_detail/title_detail.test.js