How to use the menubar.menubarMock.tray 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 synchronizing icon when receiving a synchronizing event", async () => {
    await expect(handler({newState: Synchronizing})).resolves.not.toBeDefined();
    expect(menubarMock.tray.setImage).toHaveBeenCalledWith(icons.getSyncIcon());
    expect(menubarMock.appState).toEqual(Synchronizing);
  });
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 / 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 / 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 / hendlers.js View on Github external
it("sets the idle icon when the state is Synchronizing", async () => {
        await expect(handler(Synchronizing)).resolves.toEqual(Synchronizing);
        expect(menubarMock.tray.setImage).toHaveBeenCalledWith(
          icons.getSyncIcon()
        );
        expect(menubarMock.appState).toEqual(Synchronizing);
      });
github GooBox / goobox-community-gui / __tests__ / main / popup / index.js View on Github external
beforeAll(() => {
    originalPlatform = process.platform;
    Object.defineProperty(process, "platform", {
      value: "darwin",
    });
    desktop.register.mockImplementation(() => {});
    menubarMock.tray.listeners.mockReturnValue([() => null]);
  });
github GooBox / goobox-community-gui / __tests__ / main / popup / index.js View on Github external
const getTrayEventHandler = event =>
      getEventHandler(menubarMock.tray, event);
    const menuItems = "sample menu items";

menubar

high level way to create menubar desktop applications with electron

BSD-2-Clause
Latest version published 25 days ago

Package Health Score

87 / 100
Full package analysis