MCPcopy Index your code
hub / github.com/adobe/react-spectrum / simulateMobile

Function simulateMobile

packages/@react-spectrum/test-utils/src/testSetup.ts:19–23  ·  view source on GitHub ↗
(width: number = 700)

Source from the content-addressed store, hash-verified

17 * mobile rendering.
18 */
19export function simulateMobile(width: number = 700): void {
20 jest
21 .spyOn(window.screen, 'width', 'get')
22 .mockImplementation(() => Math.min(Math.max(width, 0), 700));
23}
24
25/**
26 * Mocks screen width to simulate standard desktop experience.

Calls

no outgoing calls

Tested by

no test coverage detected