import React from 'react' import { cleanup, render, screen } from '../utilities/test-utils' import Badge from './_badge' const testId = "badge" test('default class name', () => { render( ) const kit = screen.getByTestId(testId) expect(kit).toHaveClass('pb_badge_kit_neutral') }) test('primary class name', () => { render( ) const kit = screen.getByTestId(testId) expect(kit).toHaveClass('pb_badge_kit_primary') }) test('displays text content', () => { render( ) const text = screen.getByText("+1") expect(text).toBeInTheDocument() }) test('displays rounded corners', () => { render( ) const kit = screen.getByTestId(testId) expect(kit).toHaveClass('pb_badge_kit_primary_rounded') }) test('displays color variants', () => { [ "warning", "error", "info" ].forEach((colorVariant) => { render( ) const kit = screen.getByTestId(testId) expect(kit).toHaveClass(`pb_badge_kit_${colorVariant}`) cleanup() }) }) test('displays success variant', () => { render( ) const kit = screen.getByTestId(testId) expect(kit).toHaveClass(`pb_badge_kit_success_sm `) cleanup() }) test('displays notification variants', () => { [ "notification", "notificationError" ].forEach((colorVariant) => { render( ) const kit = screen.getByTestId(testId) expect(kit).toHaveClass(`pb_badge_kit_${colorVariant === "notificationError" ? "notification_error" : "notification"}`) cleanup() }) })