fix: align Code return and sidebar collapse in the top row
This commit is contained in:
@@ -83,14 +83,32 @@ test.describe('Makelore module navigation without setup flow', () => {
|
||||
await expect(moduleReturn).toContainText('编程 Code');
|
||||
await expect(moduleReturn).toHaveAttribute('aria-label', '返回首页');
|
||||
await expect(sidebar.getByTestId('sidebar-module-return-icon')).toBeVisible();
|
||||
await expect(moduleReturn).toHaveCSS('padding-top', '8px');
|
||||
const brandBox = await sidebar.locator('.classroom-brand').boundingBox();
|
||||
const returnBox = await moduleReturn.boundingBox();
|
||||
const collapseBox = await sidebar.getByRole('button', { name: '折叠侧栏' }).boundingBox();
|
||||
const sidebarBox = await sidebar.boundingBox();
|
||||
expect(brandBox).not.toBeNull();
|
||||
expect(returnBox).not.toBeNull();
|
||||
expect(returnBox!.y).toBeGreaterThanOrEqual(brandBox!.y + brandBox!.height);
|
||||
expect(collapseBox).not.toBeNull();
|
||||
expect(returnBox!.y + returnBox!.height).toBeLessThanOrEqual(brandBox!.y);
|
||||
expect(Math.abs(returnBox!.y + returnBox!.height / 2 - collapseBox!.y - collapseBox!.height / 2)).toBeLessThan(1);
|
||||
expect(returnBox!.x + returnBox!.width).toBeLessThanOrEqual(collapseBox!.x);
|
||||
expect(sidebarBox!.x + sidebarBox!.width - collapseBox!.x - collapseBox!.width).toBeLessThanOrEqual(14);
|
||||
await expect(page.getByTestId('titlebar-sidebar-toggle')).toHaveCount(1);
|
||||
await page.screenshot({ path: test.info().outputPath('chat-code-return-entry.png') });
|
||||
|
||||
const sidebarResizer = sidebar.getByRole('separator', { name: '调整左侧功能栏宽度' });
|
||||
await sidebarResizer.press('Home');
|
||||
await expect(sidebarResizer).toHaveAttribute('aria-valuenow', '128');
|
||||
const narrowReturn = await moduleReturn.boundingBox();
|
||||
const narrowToggle = await sidebar.getByRole('button', { name: '折叠侧栏' }).boundingBox();
|
||||
expect(narrowReturn!.x + narrowReturn!.width).toBeLessThanOrEqual(narrowToggle!.x);
|
||||
await expect(moduleReturn).toBeVisible();
|
||||
await expect(sidebar.getByRole('button', { name: '折叠侧栏' })).toBeVisible();
|
||||
await page.screenshot({ path: test.info().outputPath('chat-narrow-navigation-row.png') });
|
||||
await sidebarResizer.dblclick();
|
||||
await expect(sidebarResizer).toHaveAttribute('aria-valuenow', '171');
|
||||
|
||||
await sidebar.getByRole('button', { name: '项目设置', exact: true }).click();
|
||||
await expect(page).toHaveURL(/\/project-config$/);
|
||||
await expect(page.getByTestId('project-configuration-page')).toBeVisible();
|
||||
|
||||
@@ -91,7 +91,7 @@ describe('TitleBar platform behavior', () => {
|
||||
expect(screen.queryByTestId('titlebar-logo')).not.toBeInTheDocument();
|
||||
expect(screen.queryByRole('img', { name: 'Makelore logo' })).not.toBeInTheDocument();
|
||||
expect(screen.queryByTestId('titlebar-project-context')).not.toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '折叠侧栏' })).toBeEnabled();
|
||||
expect(screen.queryByRole('button', { name: '折叠侧栏' })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders the painting title bar as a transparent overlay with the logo at the window edge', () => {
|
||||
@@ -195,7 +195,7 @@ describe('TitleBar platform behavior', () => {
|
||||
fireEvent.click(pinButton);
|
||||
expect(useSettingsStore.getState().sidebarCollapsed).toBe(false);
|
||||
expect(screen.getByTestId('titlebar-sidebar-surface')).toHaveStyle({ width: '171px', minWidth: '171px', flexBasis: '171px' });
|
||||
expect(screen.getByRole('button', { name: '折叠侧栏' })).toBeEnabled();
|
||||
expect(screen.queryByRole('button', { name: '折叠侧栏' })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('extends the ordinary titlebar sidebar surface during a hover preview', () => {
|
||||
|
||||
Reference in New Issue
Block a user