How to use the menubar.menubarMock.appState function in menubar

To help you get started, we’ve selected a few menubar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GooBox / goobox-community-gui / __tests__ / main / popup / handlers / updateState.js View on Github external
it("sets the idle icon when receiving an idle event", async () => {
    await expect(handler({newState: Idle})).resolves.not.toBeDefined();
    expect(menubarMock.tray.setImage).toHaveBeenCalledWith(icons.getIdleIcon());
    expect(menubarMock.appState).toEqual(Idle);
  });
github GooBox / goobox-community-gui / __tests__ / main / popup / index.js View on Github external
it("starts the sia backend if sia conf is true but not running", async () => {
      getConfig.mockResolvedValueOnce({
        sia: true,
        syncFolder,
      });

      await popup();
      expect(getConfig).toHaveBeenCalled();
      expect(siaStart).toHaveBeenCalledWith(syncFolder);
      expect(app.quit).not.toHaveBeenCalled();

      expect(menubarMock.tray.setImage).toHaveBeenCalledWith(
        icons.getSyncIcon()
      );
      expect(menubarMock.appState).toEqual(Synchronizing);
    });
github GooBox / goobox-community-gui / __tests__ / main / popup / hendlers.js View on Github external
it("sets the paused icon when the state is Paused", async () => {
        await expect(handler(Paused)).resolves.toEqual(Paused);
        expect(menubarMock.tray.setImage).toHaveBeenCalledWith(
          icons.getPausedIcon()
        );
        expect(menubarMock.appState).toEqual(Paused);
      });
github GooBox / goobox-community-gui / __tests__ / main / popup / index.js View on Github external
await popup();
      expect(menubar).toHaveBeenCalledWith({
        index: `file://${path.join(__dirname, "../../../src/main/popup.html")}`,
        icon: icons.getSyncIcon(),
        tooltip: app.getName(),
        preloadWindow: true,
        width: DefaultWidth,
        height: DefaultHeight,
        alwaysOnTop: true,
        showDockIcon: false,
        webPreferences: {
          nodeIntegration: true,
        },
      });
      expect(setSkipTaskBar).toHaveBeenCalledWith(true);
      expect(menubarMock.appState).toEqual(Synchronizing);
    } finally {
      setSkipTaskBar.mockRestore();
    }
  });

menubar

high level way to create menubar desktop applications with electron

BSD-2-Clause
Latest version published 2 months ago

Package Health Score

85 / 100
Full package analysis