From 62849badfa30354435510c4dcf5ce0e7d644e934 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Sat, 11 Jun 2022 22:22:35 -0500
Subject: [PATCH] tests: Fix Project model test for new column
The Project model has a new column, "Comments", added in 2020. The
tests weren't updated to handle that and were failing because the column
numbers changed.
Fixes: b1e37cc7dc95 ("Adding a comment feature on Project files")
---
src/tests/projectmodeltest.cpp | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/tests/projectmodeltest.cpp b/src/tests/projectmodeltest.cpp
index 33e940f4..c8b55457 100644
--- a/src/tests/projectmodeltest.cpp
+++ b/src/tests/projectmodeltest.cpp
@@ -54,6 +54,7 @@ void ProjectModelTest::testInvalid()
QCOMPARE(model->data(model->index(0, 7), Qt::DisplayRole), QString());
QCOMPARE(model->data(model->index(0, 8), Qt::DisplayRole), QString());
QCOMPARE(model->data(model->index(0, 9), Qt::DisplayRole), QString());
+ QCOMPARE(model->data(model->index(0, 10), Qt::DisplayRole), QString());
}
void ProjectModelTest::testHalfTranslated()
@@ -85,9 +86,10 @@ void ProjectModelTest::testHalfTranslated()
QCOMPARE(model->data(model->index(0, 4), Qt::DisplayRole), 1);
QCOMPARE(model->data(model->index(0, 5), Qt::DisplayRole), 2);
QCOMPARE(model->data(model->index(0, 6), Qt::DisplayRole), 3);
- QCOMPARE(model->data(model->index(0, 7), Qt::DisplayRole), QStringLiteral("2019-05-20 03:26+0200"));
- QCOMPARE(model->data(model->index(0, 8), Qt::DisplayRole), QStringLiteral("2019-06-13 08:53+0300"));
- QCOMPARE(model->data(model->index(0, 9), Qt::DisplayRole), QStringLiteral("Alexander Potashev <aspotashev@gmail.com>"));
+ QCOMPARE(model->data(model->index(0, 7), Qt::DisplayRole), QStringLiteral());
+ QCOMPARE(model->data(model->index(0, 8), Qt::DisplayRole), QStringLiteral("2019-05-20 03:26+0200"));
+ QCOMPARE(model->data(model->index(0, 9), Qt::DisplayRole), QStringLiteral("2019-06-13 08:53+0300"));
+ QCOMPARE(model->data(model->index(0, 10), Qt::DisplayRole), QStringLiteral("Alexander Potashev <aspotashev@gmail.com>"));
}
QTEST_GUILESS_MAIN(ProjectModelTest)
--
2.36.0