You're hitting a limitation of jsdom — it doesn't support CSS media queries or actual rendering. So even if you stub innerWidth, CSS like @media (min-width: 768px) won’t trigger.
To fix this:
vi.stubGlobal('matchmedia', query => ({
matches: query.includes('min-width: 768px'),
addListener: () => {},
removeListener: () => {}
}));
Pure CSS based visibility be tested in Vitest/jsdom, it's not supported.