-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2112 from opossum-tool/introduce-qa-mode
Introduce QA mode
- Loading branch information
Showing
24 changed files
with
221 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// SPDX-FileCopyrightText: Meta Platforms, Inc. and its affiliates | ||
// SPDX-FileCopyrightText: TNG Technology Consulting GmbH <https://www.tngtech.com> | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { Menu, MenuItem } from 'electron'; | ||
import { makeFirstIconVisibleAndSecondHidden } from '../iconHelpers'; | ||
|
||
jest.mock('electron', () => ({ | ||
Menu: { | ||
setApplicationMenu: jest.fn(), | ||
buildFromTemplate: jest.fn(), | ||
getApplicationMenu: jest.fn(), | ||
}, | ||
})); | ||
jest.mock('electron-is-dev', () => false); | ||
|
||
describe('makeFirstIconVisibleAndSecondHidden', () => { | ||
let toBeVisibleMenuItem: Partial<MenuItem>; | ||
let toBeHiddenMenuItem: Partial<MenuItem>; | ||
|
||
it('should make the first item visible and the second item hidden', () => { | ||
toBeVisibleMenuItem = { visible: false }; | ||
toBeHiddenMenuItem = { visible: true }; | ||
(Menu.getApplicationMenu as jest.Mock).mockImplementation(() => ({ | ||
getMenuItemById: jest.fn().mockImplementation((id) => { | ||
if (id === 'toBeVisibleMenuItem') return toBeVisibleMenuItem; | ||
if (id === 'toBeHiddenMenuItem') return toBeHiddenMenuItem; | ||
}), | ||
})); | ||
|
||
makeFirstIconVisibleAndSecondHidden( | ||
'toBeVisibleMenuItem', | ||
'toBeHiddenMenuItem', | ||
); | ||
|
||
expect(toBeVisibleMenuItem.visible).toBe(true); | ||
expect(toBeHiddenMenuItem.visible).toBe(false); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.