Update soul-content project
This commit is contained in:
1
app/components/__tests__/PaymentTest.test.js
Normal file
1
app/components/__tests__/PaymentTest.test.js
Normal file
@@ -0,0 +1 @@
|
||||
import { render, fireEvent } from '@testing-library/react';\nimport { PaymentTest } from '../PaymentTest';\n\ndescribe('PaymentTest Component', () => {\n it('renders without crashing', () => {\n const { getByText } = render(<PaymentTest />);\n expect(getByText('测试支付')).toBeInTheDocument();\n });\n\n it('calls handleTestPayment on button click', () => {\n const consoleSpy = jest.spyOn(console, 'log').mockImplementation(() => {});\n const { getByText } = render(<PaymentTest />);\n fireEvent.click(getByText('测试支付'));\n expect(consoleSpy).toHaveBeenCalledWith('Payment result:', expect.anything());\n consoleSpy.mockRestore();\n });\n});\n
|
||||
Reference in New Issue
Block a user