From e47ec8383a6dc56ac000cfadc70ebfe67b0e1931 Mon Sep 17 00:00:00 2001
From: blaipr
Date: Tue, 16 Jun 2026 21:05:15 +0200
Subject: [PATCH] enzyme -> RTL: convert the Wizard component suite
Migrate components/Wizard off enzyme onto renderWithContexts (React Testing
Library). The PF Wizard step content is asserted in its body portal;
behaviour and assertions are preserved.
---
awx/ui/src/components/Wizard/Wizard.test.js | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/awx/ui/src/components/Wizard/Wizard.test.js b/awx/ui/src/components/Wizard/Wizard.test.js
index 35e8adf41..f5e1bad2a 100644
--- a/awx/ui/src/components/Wizard/Wizard.test.js
+++ b/awx/ui/src/components/Wizard/Wizard.test.js
@@ -1,15 +1,22 @@
import React from 'react';
-import { mount } from 'enzyme';
+import { screen } from '@testing-library/react';
+import { renderWithContexts } from '../../../testUtils/rtlContexts';
import Wizard from './Wizard';
describe('Wizard', () => {
test('renders the expected content', () => {
- const wrapper = mount(
+ renderWithContexts(
Step 1
}]}
/>
);
- expect(wrapper).toHaveLength(1);
+ // The wizard renders its first step's content (the ) plus nav entries
+ // that also read "Step 1"; the content paragraph is the unique
.
+ expect(screen.getByText('Step 1', { selector: 'p' })).toBeInTheDocument();
+ // The step's nav button is present and active.
+ expect(
+ screen.getByRole('button', { name: 'Step 1' })
+ ).toBeInTheDocument();
});
});