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

@@ -97,6 +97,9 @@
tabIndex: selected ? 0 : -1,
disabled: disabled ? true : undefined,
};
$: if (process.env.NODE_ENV === "test") {
Object.assign(propsWeControl, { ["data-headlessui-index"]: myIndex });
}
$: slotProps = { selected };
</script>