import React from 'react';
import { afterEach, describe, expect, it } from 'vitest';
import { cleanup, render, screen } from '@testing-library/react';
import { CheckoutWizardProvider } from '../WizardContext';
import { ConfirmationStep } from '../steps/ConfirmationStep';

const basePackage = {
  id: 1,
  name: 'Starter',
  price: 49,
  type: 'endcustomer',
  paddle_price_id: 'pri_test_123',
};

describe('ConfirmationStep', () => {
  afterEach(() => {
    cleanup();
  });

  it('renders the confirmation summary sections', () => {
    render(
      <CheckoutWizardProvider initialPackage={basePackage} packageOptions={[basePackage]}>
        <ConfirmationStep />
      </CheckoutWizardProvider>,
    );

    expect(screen.getByText('checkout.confirmation_step.status_title')).toBeInTheDocument();
    expect(screen.getByText('checkout.confirmation_step.package_title')).toBeInTheDocument();
    expect(screen.getByText('checkout.confirmation_step.actions_title')).toBeInTheDocument();
  });
});
