Files
desktop/test/testtrayaccountpopuppresentation.cpp
Matthieu Gallien 31cb11dd6f chore: enable use of QT_NO_KEYWORDS when compiling newtcloudCore target
Signed-off-by: Matthieu Gallien <[email protected]>
Assisted-by: ClaudeCode:claude-sonnet-5
2026-08-25 09:14:46 +02:00

56 lines
1.4 KiB
C++

/*
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: CC0-1.0
*
* This software is in the public domain, furnished "as is", without technical
* support, and with no warranty, express or implied, as to its usefulness for
* any purpose.
*/
#include "macOS/trayaccountpopup/trayaccountpopuppresentation.h"
#include <QtTest>
#include <vector>
using namespace OCC::Mac;
class TestTrayAccountPopupPresentation : public QObject
{
Q_OBJECT
private:
enum class Operation {
OrderFront,
ActivateApplication,
MakeKey,
};
private Q_SLOTS:
void ordersPopupBeforeRequestingApplicationActivation()
{
auto operations = std::vector<Operation>();
TrayAccountPopupPresentation::present(
[&operations] {
operations.push_back(Operation::OrderFront);
},
[&operations] {
operations.push_back(Operation::ActivateApplication);
},
[&operations] {
operations.push_back(Operation::MakeKey);
});
const auto expectedOperations = std::vector {
Operation::OrderFront,
Operation::ActivateApplication,
Operation::MakeKey,
};
QVERIFY(operations == expectedOperations);
}
};
QTEST_APPLESS_MAIN(TestTrayAccountPopupPresentation)
#include "testtrayaccountpopuppresentation.moc"