Skip to content

Commit ad4a807

Browse files
committed
Fix the TOTP Gui test for Ubuntu Jammy
* For some reason the C locale setting is not respected in Jammy and the test fails due to attribute sorting
1 parent 379be00 commit ad4a807

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/gui/TestGui.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,17 @@ void TestGui::testTotp()
10881088

10891089
auto* editEntryWidget = m_dbWidget->findChild<EditEntryWidget*>("editEntryWidget");
10901090
editEntryWidget->switchToPage(EditEntryWidget::Page::Advanced);
1091+
QApplication::processEvents();
1092+
// Find the "TOTP Seed" attribute in the list view
1093+
auto* attrListView = editEntryWidget->findChild<QListView*>("attributesView");
1094+
auto index = attrListView->model()->index(0, 0);
1095+
for (auto i = 0; i < attrListView->model()->rowCount(); ++i) {
1096+
index = attrListView->model()->index(i, 0);
1097+
if (attrListView->model()->data(index).toString().compare("TOTP Seed") == 0) {
1098+
break;
1099+
}
1100+
}
1101+
attrListView->setCurrentIndex(index);
10911102
auto* attrTextEdit = editEntryWidget->findChild<QPlainTextEdit*>("attributesEdit");
10921103
QTest::mouseClick(editEntryWidget->findChild<QAbstractButton*>("revealAttributeButton"), Qt::LeftButton);
10931104
QCOMPARE(attrTextEdit->toPlainText(), expectedFinalSeed);

0 commit comments

Comments
 (0)