✅ Align drawer snapshots and shortcut expectations

This commit is contained in:
Saafo committed 2026-10-28 12:16:46 +08:00
1 parent f130e8b37a
commit 3bcafbbb64
2 files changed
+11 -2

No files matched your search

@@ -130,12 +130,14 @@ describe('assembled shortcut command owners', () => {
expect(settings.getSnapshot().open).toBe(false)
const sidebar = layout.getSnapshot().layoutInfo.sidebar
press('KeyB')
expect(layout.getSnapshot().layoutInfo.sidebar).not.toBe(sidebar)
expect(layout.getSnapshot().layoutInfo.sidebar).toBe(sidebar)
press('Slash')
expect(reference.getSnapshot().open).toBe(false)
press('KeyB')
expect(layout.getSnapshot().layoutInfo.sidebar).toBe(sidebar)
expect(layout.getSnapshot().layoutInfo.sidebar).not.toBe(sidebar)
press('KeyB', true)
expect(layout.getSnapshot().layoutInfo.sidebar).not.toBe(sidebar)
press('KeyB')
expect(layout.getSnapshot().layoutInfo.sidebar).toBe(sidebar)
const menu = (commandId: ShortcutCommandId): void => {
act(() => {
@@ -144,6 +146,8 @@ describe('assembled shortcut command owners', () => {
}
menu('settings.open' as ShortcutCommandId)
expect(settings.getSnapshot().open).toBe(true)
press('KeyB')
expect(layout.getSnapshot().layoutInfo.sidebar).toBe(sidebar)
menu('settings.open' as ShortcutCommandId)
expect(settings.getSnapshot().open).toBe(false)
menu('shortcuts.open' as ShortcutCommandId)
@@ -16,6 +16,7 @@ exports[`sidebar shell snapshots > renders Windows caption controls in expanded
<button
aria-label="Open sidebar"
class="iconButton toggle"
data-sidebar-toggle="true"
type="button"
>
<svg
@@ -158,6 +159,7 @@ exports[`sidebar shell snapshots > renders Windows caption controls in expanded
<button
aria-label="Collapse sidebar"
class="iconButton toggle"
data-sidebar-toggle="true"
type="button"
>
<svg
@@ -244,6 +246,7 @@ exports[`sidebar shell snapshots > renders the collapsed rail after the crossfad
<button
aria-label="Open sidebar"
class="iconButton toggle"
data-sidebar-toggle="true"
type="button"
>
<span
@@ -404,6 +407,7 @@ exports[`sidebar shell snapshots > renders the expanded column (wordmark, capsul
<button
aria-label="Collapse sidebar"
class="iconButton toggle"
data-sidebar-toggle="true"
type="button"
>
<svg
@@ -547,6 +551,7 @@ exports[`sidebar shell snapshots > renders the expanded column in the default lo
<button
aria-label="收起侧边栏"
class="iconButton toggle"
data-sidebar-toggle="true"
type="button"
>
<svg