Skip to content

Commit aacc5c6

Browse files
OpenStaxClaudeclaude
authored andcommitted
Fix Footer tests for plain CSS migration
Updated Footer.spec.tsx to work with plain CSS migration: - Changed test to find button by className='footer-button' instead of styled component - The test uses findAll() to locate button with matching className and message ID - This fixes the "Cannot read property 'props' of undefined" error - The existing test already covers the onClick in PortalColumn2 The test "calls captureOpeningElement when 'Contact Us' is clicked in portal footer" exercises the Contact Us button in PortalColumn2, which calls: - captureOpeningElement('contactdialog') - open() from useContactDialog hook This provides the coverage that was previously missing when the test was failing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 543a707 commit aacc5c6

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/app/components/Footer/Footer.spec.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,12 @@ describe('Footer', () => {
5050
<Footer />
5151
</TestContainer>);
5252

53-
const contactUsButton = component.root.findAllByType(require('./styled').FooterButton)
54-
.find(button => button.props.children.props.id === 'i18n:footer:column1:contact-us')!;
53+
// Find button by className and message ID (migrated to plain CSS)
54+
const contactUsButton = component.root.findAll(node =>
55+
node.type === 'button' &&
56+
node.props.className === 'footer-button' &&
57+
node.props.children?.props?.id === 'i18n:footer:column1:contact-us'
58+
)[0];
5559

5660
renderer.act(() => {
5761
contactUsButton.props.onClick();

0 commit comments

Comments
 (0)