import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:feature_wordpress/feature_wordpress.dart';

void main() {
  Widget buildTestWidget(PublishStatus status) {
    return MaterialApp(
      theme: buildKcTheme(),
      home: Scaffold(body: PublishStatusChip(status: status)),
    );
  }

  group('PublishStatusChip', () {
    testWidgets('shows Draft label for draft status', (tester) async {
      await tester.pumpWidget(buildTestWidget(PublishStatus.draft));
      expect(find.text('Draft'), findsOneWidget);
    });

    testWidgets('shows Pending Review label for pendingReview status', (tester) async {
      await tester.pumpWidget(buildTestWidget(PublishStatus.pendingReview));
      expect(find.text('Pending Review'), findsOneWidget);
    });

    testWidgets('shows Published label for published status', (tester) async {
      await tester.pumpWidget(buildTestWidget(PublishStatus.published));
      expect(find.text('Published'), findsOneWidget);
    });

    testWidgets('shows Unpublished label for unpublished status', (tester) async {
      await tester.pumpWidget(buildTestWidget(PublishStatus.unpublished));
      expect(find.text('Unpublished'), findsOneWidget);
    });
  });
}
