Repository: mui/material-ui
File: packages/mui-material/src/ButtonBase/ButtonBase.test.js (JavaScript)

Code before:

      fireEvent.mouseLeave(button);
      expect(onMouseLeave.callCount).to.equal(1);
    });

 it('should propagate click events when Enter is pressed on non-native button', async () => {
        const parentClickSpy = spy();
        const buttonClickSpy = spy();

        const {user} = render(
          <div onClick={parentClickSpy}>
            <ButtonBase onClick={buttonClickSpy} component="div">
              Hello
            </ButtonBase>
          </div>,
        );

        // moves focus to the button
        await user.tab()
        await user.keyboard('{Enter}');

        expect(buttonClickSpy.callCount).to.equal(1);
        expect(parentClickSpy.callCount).to.equal(1);
      });

      it('should propagate click events when Space is released on non-native button', async () => {
        const parentClickSpy = spy();
        const buttonClickSpy = spy();

        const {user} = render(
          <div onClick={parentClickSpy}>
            <ButtonBase onClick={buttonClickSpy} component="div">
              Hello
            </ButtonBase>
          </div>,
        );

        // moves focus to the button
        await user.tab();
        await user.keyboard(' ');

        expect(buttonClickSpy.callCount).to.equal(1);
        expect(parentClickSpy.callCount).to.equal(1);
      });
  });

  describe.skipIf(isJsdom())('ripple', () => {
    describe('interactions', () => {
      it('should not have a focus ripple by default', () => {
        render(
          <ButtonBase

Review comment (bug):
The test description has incorrect indentation. It should be indented with 4 spaces to match the indentation pattern of other tests in this describe block.
```suggestion
 it('should propagate click events when Space is released on non-native button', async () => {
```

Code after:

      fireEvent.mouseLeave(button);
      expect(onMouseLeave.callCount).to.equal(1);
    });

    it('should propagate click events when Enter is pressed on non-native button', async () => {
      const parentClickSpy = spy();
      const buttonClickSpy = spy();

      const { user } = render(
        <div onClick={parentClickSpy}>
          <ButtonBase onClick={buttonClickSpy} component="div">
            Hello
          </ButtonBase>
        </div>,
      );

      // moves focus to the button
      await user.tab();
      await user.keyboard('{Enter}');

      expect(buttonClickSpy.callCount).to.equal(1);
      expect(parentClickSpy.callCount).to.equal(1);
    });

    it('should propagate click events when Space is released on non-native button', async () => {
      const parentClickSpy = spy();
      const buttonClickSpy = spy();

      const { user } = render(
        <div onClick={parentClickSpy}>
          <ButtonBase onClick={buttonClickSpy} component="div">
            Hello
          </ButtonBase>
        </div>,
      );

      // moves focus to the button
      await user.tab();
      await user.keyboard(' ');

      expect(buttonClickSpy.callCount).to.equal(1);
      expect(parentClickSpy.callCount).to.equal(1);
    });
  });

  describe.skipIf(isJsdom())('ripple', () => {
    describe('interactions', () => {
      it('should not have a focus ripple by default', () => {
        render(
          <ButtonBase