diff --git a/packages/react/src/tabs/root/TabsRoot.test.tsx b/packages/react/src/tabs/root/TabsRoot.test.tsx index 2233008e34..b1e88bf2d8 100644 --- a/packages/react/src/tabs/root/TabsRoot.test.tsx +++ b/packages/react/src/tabs/root/TabsRoot.test.tsx @@ -184,6 +184,21 @@ describe('', () => { expect(handleChange.firstCall.args[0]).to.equal(1); }); + it('should not call onValueChange on non-primary button clicks', async () => { + const handleChange = spy(); + const { getAllByRole } = await render( + + + + + + , + ); + + fireEvent.click(getAllByRole('tab')[1], { button: 2 }); + expect(handleChange.callCount).to.equal(0); + }); + it('should not call onValueChange when already selected', async () => { const handleChange = spy(); const { getAllByRole } = await render(