Skip to content

Commit

Permalink
check tray in test
Browse files Browse the repository at this point in the history
  • Loading branch information
ddanilov committed Jan 7, 2024
1 parent d257a0b commit 4c8ce01
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions tests/TestMainWindow.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2022-2023 Denis Danilov
// SPDX-FileCopyrightText: 2022-2024 Denis Danilov
// SPDX-License-Identifier: GPL-3.0-only

#include "MainWindow.h"
Expand Down Expand Up @@ -387,16 +387,19 @@ void TestMainWindow::testMenu()
#endif
QCOMPARE(actions.at(index++)->text(), "Quit");

actions = window.m_tray_menu->actions();
index = 0;
QCOMPARE(actions.at(index++)->text(), "Show window");
QCOMPARE(actions.at(index++)->text(), "Pause playing tracks");
QCOMPARE(actions.at(index++)->text(), "Resume paused tracks");
QCOMPARE(actions.at(index++)->text(), ""); // separator
if (window.m_tray_available)
{
actions = window.m_tray_menu->actions();
index = 0;
QCOMPARE(actions.at(index++)->text(), "Show window");
QCOMPARE(actions.at(index++)->text(), "Pause playing tracks");
QCOMPARE(actions.at(index++)->text(), "Resume paused tracks");
QCOMPARE(actions.at(index++)->text(), ""); // separator
#if !defined(Q_OS_MACOS)
QCOMPARE(actions.at(index++)->text(), "About");
QCOMPARE(actions.at(index++)->text(), "About");
#endif
QCOMPARE(actions.at(index++)->text(), "Quit");
QCOMPARE(actions.at(index++)->text(), "Quit");
}
}

QTEST_MAIN(TestMainWindow)
Expand Down

0 comments on commit 4c8ce01

Please sign in to comment.