diff --git a/packages/core/src/components/button/abstractButton.tsx b/packages/core/src/components/button/abstractButton.tsx index 2b9220d37f..a6e5948537 100644 --- a/packages/core/src/components/button/abstractButton.tsx +++ b/packages/core/src/components/button/abstractButton.tsx @@ -65,8 +65,9 @@ export interface IButtonProps, tagName: string) assert.isTrue(wrapper.hasClass(Classes.DISABLED)); }); + // This tests some subtle (potentialy unexpected) behavior, but it was an API decision we + // made a long time ago which we rely on and should not break. + // See https://github.com/palantir/blueprint/issues/3819#issuecomment-1189478596 + it("button is disabled when the loading prop is true, even if disabled={false}", () => { + const wrapper = button({ disabled: false, loading: true }); + assert.isTrue(wrapper.hasClass(Classes.DISABLED)); + }); + it("clicking button triggers onClick prop", () => { const onClick = spy(); button({ onClick }).simulate("click");