chore: test for app card and no data (#29570)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Joel
2025-12-12 16:01:58 +08:00
committed by GitHub
parent e244856ef1
commit 336bcfbae2
2 changed files with 117 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import React from 'react'
import { render, screen } from '@testing-library/react'
import NoData from './index'
jest.mock('react-i18next', () => ({
useTranslation: () => ({
t: (key: string) => key,
}),
}))
describe('NoData', () => {
beforeEach(() => {
jest.clearAllMocks()
})
it('should render empty state icon and text when mounted', () => {
const { container } = render(<NoData />)
expect(container.querySelector('svg')).toBeInTheDocument()
expect(screen.getByText('share.generation.noData')).toBeInTheDocument()
})
})