Skip to content

Commit edd8127

Browse files
committed
test: expose stable frontend selectors
1 parent ffa87b5 commit edd8127

4 files changed

Lines changed: 10 additions & 1 deletion

File tree

frontend/src/lib/forms/WorkItemForm.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,8 @@
571571
<div class="space-y-1">
572572
<Label color="default">{t('items.labels') || 'Labels'}</Label>
573573
<WorkspaceLabelCombobox
574+
id="create-label-picker-input"
575+
testidPrefix="create-label-picker"
574576
workspaceId={store.formData.workspace_id}
575577
bind:value={store.formData.label_names}
576578
placeholder={t('items.selectOrCreateLabels') || 'Select or create labels...'}
@@ -716,6 +718,8 @@
716718
{t('items.labels') || 'Labels'} <span style="color: var(--ds-text-danger, #ef4444);">*</span>
717719
</Label>
718720
<WorkspaceLabelCombobox
721+
id="create-label-picker-input"
722+
testidPrefix="create-label-picker"
719723
workspaceId={store.formData.workspace_id}
720724
bind:value={store.formData.label_names}
721725
placeholder={t('items.selectOrCreateLabels') || 'Select or create labels...'}

frontend/src/lib/pickers/WorkspaceLabelCombobox.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
1010
let {
1111
workspaceId,
12+
id = undefined,
13+
testidPrefix = 'workspace-label-picker',
1214
value = $bindable(/** @type {string[] | string} */ ([])),
1315
placeholder = '',
1416
class: className = '',
@@ -96,6 +98,7 @@
9698
</script>
9799
98100
<BasePicker
101+
{id}
99102
value={valueAsIds}
100103
items={labels}
101104
{loading}
@@ -109,6 +112,7 @@
109112
searchFields={['name']}
110113
getValue={(label) => label?.id}
111114
getLabel={(label) => label?.name ?? ''}
115+
optionTestid={(option) => `${testidPrefix}-option-${option.value}`}
112116
onOpen={() => onOpen?.()}
113117
onClose={() => onClose?.()}
114118
onChange={handleChange}

frontend/src/lib/workspaces/WorkspaceMembers.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@
297297
298298
function getAssignmentActionItems(assignment) {
299299
return assignment.roles.map(role => ({
300+
testid: `workspace-member-remove-role-${assignment.row_key}-${role.role_id}`,
300301
title: t('workspaceMembers.removeRoleAction', { role: getRoleName(assignmentRole(role)) }),
301302
icon: Trash2,
302303
onClick: () => assignment.type === 'group'

frontend/src/lib/workspaces/WorkspaceSettings.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@
302302
</div>
303303
</Card>
304304
{:else if workspace}
305-
<div class="space-y-6">
305+
<div class="space-y-6" data-testid={`workspace-settings-module-${activeTab}`}>
306306
<PageHeader
307307
icon={currentModule?.icon}
308308
title={t(currentModule?.labelKey)}

0 commit comments

Comments
 (0)