Sha256: 16e5a8cbe5c4cefd839ece2f1eb3a3f416e88257704dc7081cefb9a99bacf91a

Contents?: true

Size: 1.21 KB

Versions: 13

Compression:

Stored size: 1.21 KB

Contents

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

const testId = 'formpill';

test('should render classname', () => {
    render(
        <FormPill
            data={{ testid: testId }}
            text="test"
        /> 
    )

    const kit = screen.getByTestId(testId)
    expect(kit).toHaveClass('pb_form_pill_kit_primary none')
});

test('displays text content', () => {
    render(
        <FormPill
            data={{ testid: testId }}
            text="test"
        /> 
    )
  
    const text = screen.getByText("test")
    expect(text).toBeInTheDocument()
});

test('displays color variant', () => {
    render(
        <FormPill
            color={"neutral"}
            data={{ testid: testId }}
            text={"test"}
        />
    )
    const kit = screen.getByTestId(testId)
    expect(kit).toHaveClass(`pb_form_pill_kit_neutral none`)
});

test('displays size variant', () => {
    render(
        <FormPill            
            data={{ testid: testId }}
            size={"small"}
            text={"test"}
        />
    )
    const kit = screen.getByTestId('formpill')
    expect(kit).toHaveClass(`pb_form_pill_kit_primary small none`)
});

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
playbook_ui-13.33.1.pre.alpha.PLAY14143340 app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx
playbook_ui-13.33.1.pre.alpha.PLAY14143336 app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx
playbook_ui-13.33.1.pre.alpha.PLAY14063320 app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx
playbook_ui-13.33.1 app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx
playbook_ui-13.33.0.pre.alpha.PLAY14143318 app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx
playbook_ui-13.33.0.pre.alpha.PLAY14143312 app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx
playbook_ui-13.33.0.pre.alpha.PBNTR405dropdownformfixesrails3311 app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx
playbook_ui-13.33.0.pre.alpha.PLAY14143306 app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx
playbook_ui-13.33.0.pre.alpha.PLAY14143305 app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx
playbook_ui-13.33.0 app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx
playbook_ui-13.32.0.pre.alpha.PBNTR405dropdownformfixesrails3301 app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx
playbook_ui-13.32.0.pre.alpha.PLAY14143297 app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx
playbook_ui-13.31.0.pre.alpha.PLAY882formpillprimaryandneutral3201 app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx