From a5101345b28742b8df265de70c85771b0b9a9c5c Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Thu, 3 Nov 2022 17:56:42 +0700 Subject: [PATCH] add tests --- packages/mui-joy/src/Select/Select.test.tsx | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/packages/mui-joy/src/Select/Select.test.tsx b/packages/mui-joy/src/Select/Select.test.tsx index 4369e5d5be6265..d8628b0016acf1 100644 --- a/packages/mui-joy/src/Select/Select.test.tsx +++ b/packages/mui-joy/src/Select/Select.test.tsx @@ -593,4 +593,46 @@ describe('Joy + + , + ); + // Fire Click of the avatar + act(() => { + getByTestId('test-element').click(); + }); + + expect(getByRole('button', { hidden: true })).to.have.attribute('aria-expanded', 'true'); + }); + + it('should not show dropdown if stop propagation is handled', () => { + const handleClick = spy(); + const { getByTestId, getByRole } = render( + , + ); + // Fire Click of the avatar + act(() => { + getByTestId('test-element').click(); + }); + + expect(getByRole('button', { hidden: true })).to.have.attribute('aria-expanded', 'false'); + expect(handleClick.callCount).to.equal(1); + }); });