功能:完善通用云管工作台、审计与诊断能力
This commit is contained in:
1 parent
5ac692724d
commit
9f05aa20ea
225 files changed
+14266
-141
No files matched your search
@@ -11,6 +11,7 @@ class DesktopListPageTest : public QObject {
|
||||
|
||||
private slots:
|
||||
void firstClickDisablesActionsAndBlocksDuplicate();
|
||||
void poweredOffSharedDesktopCanStart();
|
||||
};
|
||||
|
||||
void DesktopListPageTest::firstClickDisablesActionsAndBlocksDuplicate() {
|
||||
@@ -49,5 +50,26 @@ void DesktopListPageTest::firstClickDisablesActionsAndBlocksDuplicate() {
|
||||
QVERIFY(editButton->isEnabled());
|
||||
}
|
||||
|
||||
void DesktopListPageTest::poweredOffSharedDesktopCanStart() {
|
||||
DesktopListPage page;
|
||||
DesktopInfo desktop;
|
||||
desktop.id = QStringLiteral("shared-linux");
|
||||
desktop.name = QStringLiteral("Ubuntu");
|
||||
desktop.os = QStringLiteral("Ubuntu");
|
||||
desktop.state = DesktopState::kAvailable;
|
||||
desktop.powerOnConnect = true;
|
||||
desktop.poweredOff = true;
|
||||
page.setDesktops({desktop});
|
||||
auto* button = page.findChild<QPushButton*>(QStringLiteral("connectButton"));
|
||||
QVERIFY(button);
|
||||
QVERIFY(button->isEnabled());
|
||||
QCOMPARE(button->text(), QStringLiteral("启动并连接"));
|
||||
QSignalSpy spy(&page, &DesktopListPage::desktopSelected);
|
||||
button->click();
|
||||
QCOMPARE(spy.count(), 1);
|
||||
QCOMPARE(spy.at(0).at(0).toString(), desktop.id);
|
||||
QVERIFY(!button->isEnabled());
|
||||
}
|
||||
|
||||
QTEST_MAIN(DesktopListPageTest)
|
||||
#include "test_desktop_list_page.moc"
|
||||
Reference in new issue
Block a user