feat: add data-testid to dialog components for stable test selectors

- Add data-testid='settings-dialog' to settings container

- Add data-testid='about-panel' to AboutPanel

- Add data-testid='settings-tab-{key}' to all sidebar navigation items

Amp-Thread-ID: https://ampcode.com/threads/T-019c1359-48cc-7676-abc8-2de8c57b52cf
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Alexander Brown
2026-01-31 01:22:12 -08:00
parent bbe9267f4a
commit 31c643d29e
5 changed files with 30 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
<template>
<div
data-testid="settings-dialog"
:class="
teamWorkspacesEnabled
? 'flex h-full w-full overflow-auto flex-col md:flex-row'
@@ -50,10 +51,17 @@
<template v-else #optiongroup>
<Divider class="my-0" />
</template>
<!-- Workspace mode: custom workspace item -->
<template v-if="teamWorkspacesEnabled" #option="{ option }">
<WorkspaceSidebarItem v-if="option.key === 'workspace'" />
<span v-else>{{ option.translatedLabel }}</span>
<!-- Custom option template with data-testid for stable test selectors -->
<template #option="{ option }">
<span
:data-testid="`settings-tab-${option.key}`"
class="settings-tab-option"
>
<WorkspaceSidebarItem
v-if="teamWorkspacesEnabled && option.key === 'workspace'"
/>
<template v-else>{{ option.translatedLabel }}</template>
</span>
</template>
</Listbox>
</ScrollPanel>