polish single vehicle entry workspace

This commit is contained in:
lingniu
2026-07-18 11:09:27 +08:00
parent 5805635ccf
commit 622c4398ec
7 changed files with 45 additions and 28 deletions

View File

@@ -77,11 +77,14 @@ test('marks the content as a full-height track workspace after sidebar navigatio
<Routes><Route element={<AppShell />}><Route path="*" element={<span></span>} /></Route></Routes>
</MemoryRouter>);
expect(document.querySelector('.v2-content')).not.toHaveClass('is-track-workspace');
const content = document.querySelector<HTMLElement>('.v2-content')!;
expect(content).not.toHaveClass('is-track-workspace');
content.scrollTop = 240;
scrollTo.mockClear();
fireEvent.click(screen.getByRole('link', { name: '轨迹回放' }));
await waitFor(() => expect(document.querySelector('.v2-content')).toHaveClass('is-track-workspace'));
expect(document.querySelector<HTMLElement>('.v2-content')?.scrollTop).toBe(0);
expect(scrollTo).toHaveBeenCalledWith({ top: 0, left: 0, behavior: 'auto' });
expect(screen.getByRole('heading', { name: '轨迹回放' })).toBeInTheDocument();
});