Add test data to Tab components

This commit is contained in:
Ryan Gossiaux
2021-12-29 10:32:28 -10:00
parent 9772e49054
commit 0996de1e6e
2 changed files with 7 additions and 0 deletions

View File

@@ -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