Sha256: f6b04a92f4edc3603552f114c2214bbaba305436032ecf8fab668d07ae953f1e
Contents?: true
Size: 1.98 KB
Versions: 460
Compression:
Stored size: 1.98 KB
Contents
import React from 'react' import { render, screen } from '../utilities/test-utils' import TextInput from './_text_input' const testId = 'text-input1', kitClass = 'pb_text_input_kit' test('returns namespaced class name', () => { render( <TextInput data={{ testid: testId }} label="First Name" placeholder="Enter first name" /> ) const kit = screen.getByTestId(testId) expect(kit).toHaveClass(`${kitClass} mb_sm`) }) test('returns additional class name', () => { render( <TextInput className="additional_class" data={{ testid: testId }} label="First Name" placeholder="Enter first name" /> ) const kit = screen.getByTestId(testId) expect(kit).toHaveClass(`${kitClass} additional_class`) }) test('returns additional class name', () => { render( <TextInput dark data={{ testid: testId }} label="First Name" placeholder="Enter first name" /> ) const kit = screen.getByTestId(testId) expect(kit).toHaveClass(`${kitClass} dark`) }) test('returns additional class name', () => { render( <TextInput data={{ testid: testId }} error="Please enter a valid email" label="First Name" placeholder="Enter first name" /> ) const kit = screen.getByTestId(testId) expect(kit).toHaveClass(`${kitClass} error`) }) test('returns additional class name', () => { render( <TextInput dark data={{ testid: testId }} error="Please enter a valid email" label="First Name" placeholder="Enter first name" /> ) const kit = screen.getByTestId(testId) expect(kit).toHaveClass(`${kitClass} dark error`) }) test('returns additional class name', () => { render( <TextInput data={{ testid: testId }} label="First Name" marginBottom="lg" placeholder="Enter first name" /> ) const kit = screen.getByTestId(testId) expect(kit).toHaveClass(`${kitClass} mb_lg`) })
Version data entries
460 entries across 460 versions & 1 rubygems