Skip to content

Commit 06716e9

Browse files
committed
fix: provide stable frontend test selectors
1 parent c806fe5 commit 06716e9

6 files changed

Lines changed: 11 additions & 2 deletions

File tree

frontend/src/lib/components/DataTable.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171
<tr>
172172
{#each columns as column, colIndex}
173173
<th
174+
data-testid={`table-column-${column.key}`}
174175
class="{thClass} {getColumnAlign(column)} {getColumnWidth(column)} {column.sortable ? 'group cursor-pointer select-none' : ''}"
175176
style="color: var(--ds-text); {getColumnWidthStyle(column)} {column.headerStyle || ''}"
176177
onclick={() => toggleSort(column)}

frontend/src/lib/features/collections/BoardColumn.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
data-swimlane-parent-id={swimlaneParentId}
3636
data-status-id={statusId}
3737
>
38+
<span class="sr-only" data-testid={`board-column-status-${statusId}`} aria-hidden="true"></span>
3839
<div
3940
class="border-b border-t-4 p-4"
4041
style="border-bottom-color: var(--ctx-border, var(--ds-border)); border-top-color: {column.color};"

frontend/src/lib/features/collections/CollectionBoard.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,7 @@
16861686
title={t('collections.expandColumn', { name: objectDisplayName(column, 'status') })}
16871687
onclick={() => toggleColumnCollapse(column.id)}
16881688
>
1689+
<span class="sr-only" data-testid={`board-column-status-${column.status_ids[0]}`} aria-hidden="true"></span>
16891690
<ChevronRight class="w-4 h-4 flex-shrink-0" style={styles.glassTextStyle} />
16901691
<span class="board-column-collapsed-name font-semibold text-sm break-words" style={styles.glassTextStyle}>
16911692
{objectDisplayName(column, 'status')}

frontend/src/lib/features/workflows/AllIncomingEdge.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@
4343
/>
4444

4545
<foreignObject x={labelX - 24} y={labelY - 10} width="48" height="20" style="overflow: visible;">
46-
<div class="all-incoming-label" class:all-incoming-label-selected={selected} title={t('workflows.fromAllStatuses')}>
46+
<div
47+
class="all-incoming-label"
48+
class:all-incoming-label-selected={selected}
49+
data-testid={`workflow-${id}`}
50+
title={t('workflows.fromAllStatuses')}
51+
>
4752
{t('workflows.allStatuses')}
4853
</div>
4954
</foreignObject>

frontend/src/lib/features/workflows/StatusNode.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
</script>
2929

3030
<div
31+
data-testid={`workflow-status-node-${data.statusId}`}
3132
class="status-node rounded border-2 shadow-lg select-none transition-all duration-200 group relative"
3233
class:border-blue-500={selected}
3334
class:border-gray-300={!selected}

frontend/src/lib/features/workflows/SvelteFlowDesigner.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@
509509
</div>
510510
511511
<!-- Svelte Flow Canvas -->
512-
<div class="flex-1 relative">
512+
<div class="flex-1 relative" data-testid="workflow-canvas">
513513
<SvelteFlow
514514
bind:nodes
515515
bind:edges

0 commit comments

Comments
 (0)