feat(GODT-2782): Add category name in decribe issue view + apply review comments.

This commit is contained in:
Romain LE JEUNE
2023-08-03 09:25:00 +02:00
parent 1b95c290f1
commit cc33423c1f
15 changed files with 103 additions and 77 deletions

View File

@ -94,7 +94,7 @@ void BugReportFlowFixture::feedTempFile(const QString& json) {
//****************************************************************************************************************************************************
TEST_F(BugReportFlowFixture, noFile) {
EXPECT_FALSE(flow_.parse(""));
EXPECT_EQ(flow_.categories(), QStringList());
EXPECT_EQ(flow_.categories(), QVariantList());
EXPECT_EQ(flow_.questions(), QVariantList());
}
@ -105,7 +105,7 @@ TEST_F(BugReportFlowFixture, noFile) {
TEST_F(BugReportFlowFixture, emptyFile) {
feedTempFile("");
EXPECT_TRUE(flow_.parse(file_.fileName()));
EXPECT_EQ(flow_.categories(), QStringList());
EXPECT_EQ(flow_.categories(), QVariantList());
EXPECT_EQ(flow_.questions(), QVariantList());
}
@ -117,10 +117,12 @@ TEST_F(BugReportFlowFixture, validFile) {
feedTempFile(goodJson);
EXPECT_TRUE(flow_.parse(file_.fileName()));
QStringList categories = flow_.categories();
QVariantList categories = flow_.categories();
QVariantList questions = flow_.questions();
EXPECT_EQ(categories.count(), 1);
EXPECT_EQ(categories[0], "I can't receive mail");
QVariantMap cat = categories[0].toMap();
EXPECT_EQ(cat["name"].toString(), "I can't receive mail");
EXPECT_EQ(cat["hint"].toString(), "");
EXPECT_EQ(questions.count(), 1);
QVariantMap q1 = questions[0].toMap();
EXPECT_EQ(q1.value("id").toInt(), 0);
@ -138,7 +140,7 @@ TEST_F(BugReportFlowFixture, validFile) {
EXPECT_TRUE(flow_.setAnswer(0, "pwet"));
EXPECT_FALSE(flow_.setAnswer(1, "pwet"));
EXPECT_EQ(flow_.collectAnswers(0), " - What happened?\n\rpwet\n\r");
EXPECT_EQ(flow_.collectAnswers(0), " > What happened?\n\rpwet\n\r");
EXPECT_EQ(flow_.collectAnswers(1), "");
EXPECT_EQ(flow_.getAnswer(0), "pwet");
EXPECT_EQ(flow_.getAnswer(1), "");
@ -175,6 +177,6 @@ TEST_F(BugReportFlowFixture, badVersionFile) {
"}");
EXPECT_TRUE(flow_.parse(file_.fileName()));
EXPECT_EQ(flow_.categories(), QStringList());
EXPECT_EQ(flow_.categories(), QVariantList());
EXPECT_EQ(flow_.questions(), QVariantList());
}