Repository: electron/electron
File: spec/api-browser-window-spec.ts (TypeScript)

Code before:
            width: 300,
            height: 300,
            minWidth: 300,
            minHeight: 300
          });
          const bounds = w.getBounds();
          w.once('minimize', () => {
            w.restore();
          });
          const restore = once(w, 'restore');
          w.show();
          w.minimize();
          await restore;
          expectBoundsEqual(w.getNormalBounds(), bounds);
        });
      });

      ifdescribe(process.platform === 'win32')('Fullscreen state', () => {
        describe('with properties', () => {
          it('can be set with the fullscreen constructor option', () => {
            w = new BrowserWindow({ fullscreen: true });
            expect(w.fullScreen).to.be.true();
          });

          it.skip('does not go fullscreen if roundedCorners are enabled', async () => {
            w = new BrowserWindow({ frame: false, roundedCorners: false, fullscreen: true });
            expect(w.fullScreen).to.be.false();
          });

          it('can be changed', () => {
            w.fullScreen = false;
            expect(w.fullScreen).to.be.false();
            w.fullScreen = true;
            expect(w.fullScreen).to.be.true();
          });

          it('checks normal bounds when fullscreen\'ed', async () => {
            const bounds = w.getBounds();
            const enterFullScreen = once(w, 'enter-full-screen');
            w.show();
            w.fullScreen = true;
            await enterFullScreen;
            expectBoundsEqual(w.getNormalBounds(), bounds);
          });

          it('updates normal bounds after resize and fullscreen', async () => {
            const size = [300, 400];
            const resize = once(w, 'resize');
            w.setSize(size[0], size[1]);
            await resize;
            const original = w.getBounds();

Review comment (suggestion):
I understand that this test wasn't running before, but we should add a TODO comment as to why this is disabled.

Code after:
            width: 300,
            height: 300,
            minWidth: 300,
            minHeight: 300
          });
          const bounds = w.getBounds();
          w.once('minimize', () => {
            w.restore();
          });
          const restore = once(w, 'restore');
          w.show();
          w.minimize();
          await restore;
          expectBoundsEqual(w.getNormalBounds(), bounds);
        });
      });

      ifdescribe(process.platform === 'win32')('Fullscreen state', () => {
        describe('with properties', () => {
          it('can be set with the fullscreen constructor option', () => {
            w = new BrowserWindow({ fullscreen: true });
            expect(w.fullScreen).to.be.true();
          });

          // FIXME: this test needs to be fixed and re-enabled.
          it.skip('does not go fullscreen if roundedCorners are enabled', async () => {
            w = new BrowserWindow({ frame: false, roundedCorners: false, fullscreen: true });
            expect(w.fullScreen).to.be.false();
          });

          it('can be changed', () => {
            w.fullScreen = false;
            expect(w.fullScreen).to.be.false();
            w.fullScreen = true;
            expect(w.fullScreen).to.be.true();
          });

          it('checks normal bounds when fullscreen\'ed', async () => {
            const bounds = w.getBounds();
            const enterFullScreen = once(w, 'enter-full-screen');
            w.show();
            w.fullScreen = true;
            await enterFullScreen;
            expectBoundsEqual(w.getNormalBounds(), bounds);
          });

          it('updates normal bounds after resize and fullscreen', async () => {
            const size = [300, 400];
            const resize = once(w, 'resize');
            w.setSize(size[0], size[1]);
            await resize;