PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.4.20
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.4.20
1.4.21 1.4.20 1.4.19 1.4.18 1.4.17 1.4.16 1.4.15 1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.54 1.3.53 1.3.52 All 184 releases
disco / backend / views / components / Analytics / __tests__ / components / StatusBadge.test.jsx

StatusBadge.test.jsx in Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO 1.4.20, at backend/views/components/Analytics/__tests__/components/StatusBadge.test.jsx

29 lines 973 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import '@testing-library/jest-dom';
2 import { render, screen } from '@testing-library/react';
3 import StatusBadge from '../../components/campaigns/StatusBadge';
4
5 describe('StatusBadge', () => {
6 it('renders "active" status', () => {
7 render(<StatusBadge status="active" />);
8 expect(screen.getByText('active')).toBeInTheDocument();
9 });
10
11 it('renders "expired" status', () => {
12 render(<StatusBadge status="expired" />);
13 expect(screen.getByText('expired')).toBeInTheDocument();
14 });
15
16 it('renders "deleted" status', () => {
17 render(<StatusBadge status="deleted" />);
18 expect(screen.getByText('deleted')).toBeInTheDocument();
19 });
20
21 it('renders unknown status with fallback style', () => {
22 const { container } = render(<StatusBadge status="paused" />);
23 expect(screen.getByText('paused')).toBeInTheDocument();
24 // Dot should exist with fallback color
25 const dot = container.querySelector('[style*="background-color"]');
26 expect(dot).toBeInTheDocument();
27 });
28 });
29