Add test data to Tab components
This commit is contained in:
@@ -33,6 +33,10 @@
|
||||
"aria-labelledby": $api.tabs[myIndex]?.id,
|
||||
tabIndex: selected ? 0 : -1,
|
||||
};
|
||||
|
||||
$: if (process.env.NODE_ENV === "test") {
|
||||
Object.assign(propsWeControl, { ["data-headlessui-index"]: myIndex });
|
||||
}
|
||||
</script>
|
||||
|
||||
<Render
|
||||
|
||||
Reference in New Issue
Block a user