MCPcopy Create free account
hub / github.com/coder/coder / TestHarness

Function TestHarness

site/src/components/Tabs/utils/useKebabMenu.test.tsx:52–85  ·  view source on GitHub ↗
({ tabGap = 0 }: { tabGap?: number })

Source from the content-addressed store, hash-verified

50] as const;
51
52const TestHarness = ({ tabGap = 0 }: { tabGap?: number }) => {
53 const { containerRef, visibleTabs, overflowTabs, getTabMeasureProps } =
54 useKebabMenu({
55 tabs,
56 enabled: true,
57 isActive: true,
58 overflowTriggerWidth: 44,
59 });
60
61 return (
62 <div>
63 <div
64 ref={containerRef}
65 style={{ display: "flex", columnGap: `${tabGap}px` }}
66 >
67 {tabs.map((tab) => (
68 <button
69 key={tab.value}
70 type="button"
71 {...getTabMeasureProps(tab.value)}
72 >
73 {tab.label}
74 </button>
75 ))}
76 </div>
77 <div data-testid="visible-values">
78 {visibleTabs.map((tab) => tab.value).join(",")}
79 </div>
80 <div data-testid="overflow-values">
81 {overflowTabs.map((tab) => tab.value).join(",")}
82 </div>
83 </div>
84 );
85};
86
87describe("useKebabMenu", () => {
88 beforeEach(() => {

Callers

nothing calls this directly

Calls 2

useKebabMenuFunction · 0.90
getTabMeasurePropsFunction · 0.85

Tested by

no test coverage detected