/* @vitest-environment jsdom */ import { render, screen } from '@testing-library/react'; import { expect, test, vi } from 'vitest'; import { PlatformActionButton } from '../common/PlatformActionButton'; import { PlatformProfileModalShell } from './PlatformProfileModalShell'; test('PlatformProfileModalShell forwards footer content into shared modal footer chrome', () => { render( 取消 保存 } >
昵称输入区
, ); const dialog = screen.getByRole('dialog', { name: '修改昵称' }); const body = screen.getByText('昵称输入区').parentElement; const footerButton = screen.getByRole('button', { name: '保存' }); const footer = footerButton.closest('div'); expect(dialog).toBeTruthy(); expect(body?.className).toContain('px-5'); expect(body?.className).toContain('py-5'); expect(footer?.className).toContain('border-t'); expect(footer?.className).toContain('grid'); expect(footer?.className).toContain('pt-0'); });