项目文件夹

文件
wehub-resource-sync 98e40dac97
CLI Smoke Test / smoke-test-linux (20) (push) Has been cancelled
CLI Smoke Test / smoke-test-linux (24) (push) Has been cancelled
CLI Smoke Test / smoke-test-windows (20) (push) Has been cancelled
CLI Smoke Test / smoke-test-windows (24) (push) Has been cancelled
Expo App TypeScript typecheck / typecheck (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:40:49 +08:00

59 行
1.8 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { getNewSessionSidebarLayout } from './newSessionSidebarLayout';
describe('getNewSessionSidebarLayout', () => {
it('enables the right sidebar on supported wide web layouts', () => {
expect(getNewSessionSidebarLayout({
platform: 'web',
isMac: false,
fileDiffsSidebarEnabled: true,
zenMode: false,
windowWidth: 1200,
})).toEqual({
canShowSidebar: true,
showSidebar: true,
sidebarWidth: 360,
});
});
it('disables the sidebar when the setting is off', () => {
expect(getNewSessionSidebarLayout({
platform: 'web',
isMac: false,
fileDiffsSidebarEnabled: false,
zenMode: false,
windowWidth: 1200,
}).showSidebar).toBe(false);
});
it('disables the sidebar in zen mode', () => {
expect(getNewSessionSidebarLayout({
platform: 'web',
isMac: false,
fileDiffsSidebarEnabled: true,
zenMode: true,
windowWidth: 1200,
}).showSidebar).toBe(false);
});
it('disables the sidebar below the minimum width', () => {
expect(getNewSessionSidebarLayout({
platform: 'web',
isMac: false,
fileDiffsSidebarEnabled: true,
zenMode: false,
windowWidth: 1099,
}).showSidebar).toBe(false);
});
it('disables the sidebar on unsupported native platforms', () => {
expect(getNewSessionSidebarLayout({
platform: 'ios',
isMac: false,
fileDiffsSidebarEnabled: true,
zenMode: false,
windowWidth: 1400,
}).showSidebar).toBe(false);
});
});