Sha256: 87c61c4a129b5454ce75b9b29d712814b7f87cca35a29dd4a63d45f68877c3e9
Contents?: true
Size: 1.97 KB
Versions: 502
Compression:
Stored size: 1.97 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) }) 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
502 entries across 502 versions & 1 rubygems