镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Commit 11d3139

Browse files
chrisbbreuerclaude
andcommitted
feat(components): a native Settings sidebar item has a test id
settings-item-<id>, so a UI test driving the AppKit host can open a pane by pressing its item. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 parent 78f140a commit 11d3139

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎docs/guide/settings-window.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ that `setting`, scrolls to it and highlights it; false when there is none),
135135
`back()`, `forward()`, `focusSearch()`, `getPane()`. On a native host, which
136136
has no document to find the window in, `componentApi(id)` takes the window's
137137
`id` and nothing else.
138+
A native sidebar item carries the test id `settings-item-<id>`, so a UI test can
139+
open a pane by pressing it.
138140

139141
```ts
140142
import { componentApi } from '@stacksjs/components/component-api'

‎packages/components/src/ui/settings/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ that `setting`, scrolls to it and highlights it; false when there is none),
133133
`back()`, `forward()`, `focusSearch()`, `getPane()`. On a native host, which
134134
has no document to find the window in, `componentApi(id)` takes the window's
135135
`id` and nothing else.
136+
A native sidebar item carries the test id `settings-item-<id>`, so a UI test can
137+
open a pane by pressing it.
136138

137139
```ts
138140
import { componentApi } from '@stacksjs/components/component-api'

‎packages/components/src/ui/settings/SettingsSidebarItem.stx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const glyphInk = settingsNativeGlyph(tone)
3535
role="tab"
3636
aria-selected="false"
3737
aria-label="{{ label }}"
38+
testID="settings-item-{{ paneId }}"
3839
data-settings-item="{{ paneId }}"
3940
data-label="{{ label }}"
4041
data-keywords="{{ keywords }}"

0 commit comments

Comments
 (0)