Sha256: d913b26c0a664c87793a1e77eee15ff5c06026db661d6a0e8ffce4b37f6c6c77

Contents?: true

Size: 1.88 KB

Versions: 753

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

753 entries across 753 versions & 1 rubygems

Version Path
playbook_ui-14.9.0.pre.rc.9 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.8.0.pre.alpha.PLAY1680newwidthprop4661 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.8.0.pre.alpha.PLAY1658tanstackbump4657 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.8.0.pre.alpha.PLAY1649rolloutheightglobalprops4635 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.9.0.pre.rc.8 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4617 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.9.0.pre.rc.7 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.9.0.pre.rc.6 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.9.0.pre.rc.5 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.8.0.pre.alpha.pbntr661createstickyleftprop4612 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.8.0.pre.alpha.play1648heightglobalprops4606 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.9.0.pre.rc.4 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.9.0.pre.rc.3 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.9.0.pre.rc.2 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.8.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4567 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.8.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4565 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4563 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.8.0.pre.alpha.play1648heightglobalprops4559 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.9.0.pre.rc.1 app/pb_kits/playbook/pb_title_detail/title_detail.test.js
playbook_ui-14.8.0.pre.alpha.PLAY16254545 app/pb_kits/playbook/pb_title_detail/title_detail.test.js