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.27.0.pre.alpha.expandednotworking853 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.27.0 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.1.pre.alpha.railsmultilevelimprovements842 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.1.pre.alpha.railsmultilevelimprovements837 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.1.pre.alpha.PLAY860PhoneNumInputOptions836 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.1.pre.alpha.railsmultilevelimprovements835 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.1.pre.alpha.play716popoverkitcloseonclickissue833 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.1.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown831 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.1 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0.pre.alpha.multiselectfixes825 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown822 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0.pre.alpha.multiselectfixes821 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown818 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown817 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown815 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown813 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0.pre.alpha.alphafix812 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0.pre.alpha.alphafix810 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0.pre.alpha.railsmultilevelimprovements805 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-12.26.0.pre.alpha.multiselectfixes798 app/pb_kits/playbook/pb_title_detail/title_detail.test.js