We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c78566 commit 9fbae28Copy full SHA for 9fbae28
tests/hooks.test.tsx
@@ -513,14 +513,12 @@ describe('hooks', () => {
513
return <div>{isMobile ? 'mobile' : 'pc'}</div>;
514
};
515
516
- const { container } = render(<Demo />);
517
- expect(container.textContent).toBe('pc');
518
-
519
const navigatorSpy = jest
520
.spyOn(navigator, 'userAgent', 'get')
521
.mockImplementation(() => 'Android');
522
- const { container: container2 } = render(<Demo />);
523
- expect(container2.textContent).toBe('mobile');
+
+ const { container } = render(<Demo />);
+ expect(container.textContent).toBe('mobile');
524
525
navigatorSpy.mockRestore();
526
});
0 commit comments