Skip to content

Commit 3e0c612

Browse files
committed
fixup: useId for tab id for e2e test tab closing selector
1 parent 7749a93 commit 3e0c612

File tree

1 file changed

+4
-0
lines changed
  • packages/compass-components/src/components/workspace-tabs

1 file changed

+4
-0
lines changed

packages/compass-components/src/components/workspace-tabs/tab.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { spacing } from '@leafygreen-ui/tokens';
55
import type { GlyphName } from '@leafygreen-ui/icon';
66
import { useSortable } from '@dnd-kit/sortable';
77
import { CSS as cssDndKit } from '@dnd-kit/utilities';
8+
import { useId } from '@react-aria/utils';
89
import { useDarkMode } from '../../hooks/use-theme';
910
import { Icon, IconButton } from '../leafygreen';
1011
import { mergeProps } from '../../utils/merge-props';
@@ -253,6 +254,8 @@ function Tab({
253254
cursor: 'grabbing !important',
254255
};
255256

257+
const tabId = useId();
258+
256259
return (
257260
<Tooltip
258261
enabled={!!tooltip}
@@ -281,6 +284,7 @@ function Tab({
281284
data-testid="workspace-tab-button"
282285
data-connection-name={connectionName}
283286
data-type={type}
287+
id={tabId}
284288
{...tabProps}
285289
>
286290
{iconGlyph === 'Logo' && (

0 commit comments

Comments
 (0)