mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 11:33:02 +00:00
test: fix test warning regarding async suspension rendering
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
import { renderWithProviders, screen, waitFor } from '~/test-utils/test-helper';
|
||||
import App from '~/App';
|
||||
import { renderWithProviders, screen } from '~/test-utils/test-helper';
|
||||
|
||||
test('should be able to render App', () => {
|
||||
vi.mock('../decrypt-worker/client', () => {
|
||||
return {
|
||||
workerClientBus: {
|
||||
request: vi.fn().mockResolvedValue('dummy'),
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
test('should be able to render App', async () => {
|
||||
renderWithProviders(<App />);
|
||||
|
||||
// Should eventually load sdk version
|
||||
await waitFor(() => screen.getByTestId('sdk-version'));
|
||||
|
||||
// Quick sanity check of known strings.
|
||||
expect(screen.getByText(/仅在浏览器内对文件进行解锁/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/UnlockMusic 团队/i)).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user