feat: add long-term projects with AI creation
- Add project model, schema v4, sync triggers, and server support\n- Add project panel, deadline countdown, manual create/edit/complete/delete\n- Parse AI project operations and show them in the proposal diff\n- Sync projects to Android and display them read-only\n- Rebuild AppImage and update validation docs and screenshots
This commit is contained in:
@@ -29,6 +29,7 @@ private slots:
|
||||
void searchFindsSchedules();
|
||||
void createsRecurringSchedules();
|
||||
void startAndLeadReminders();
|
||||
void projectCrudAndPersistence();
|
||||
};
|
||||
|
||||
namespace
|
||||
@@ -474,5 +475,45 @@ void TestServices::startAndLeadReminders()
|
||||
QCOMPARE(leadSpy.count(), 1);
|
||||
}
|
||||
|
||||
void TestServices::projectCrudAndPersistence()
|
||||
{
|
||||
Context context;
|
||||
QVERIFY(context.open());
|
||||
|
||||
const QDate deadline = QDate::currentDate().addMonths(1);
|
||||
QString error;
|
||||
QVERIFY2(context.service->createProject(QStringLiteral("飞行控制器项目"),
|
||||
QStringLiteral("完成飞控板固件与测试"),
|
||||
deadline,
|
||||
&error),
|
||||
qPrintable(error));
|
||||
QVector<Project> projects = context.service->projects();
|
||||
QCOMPARE(projects.size(), 1);
|
||||
QCOMPARE(projects.first().title, QStringLiteral("飞行控制器项目"));
|
||||
QCOMPARE(projects.first().deadline.value(), deadline);
|
||||
const QString id = projects.first().id;
|
||||
|
||||
QVERIFY2(context.service->updateProject(id,
|
||||
QStringLiteral("飞行控制器项目 v2"),
|
||||
QStringLiteral("完成固件、测试与文档"),
|
||||
deadline.addDays(7),
|
||||
&error),
|
||||
qPrintable(error));
|
||||
auto updated = context.service->projectById(id);
|
||||
QVERIFY(updated.has_value());
|
||||
QCOMPARE(updated->title, QStringLiteral("飞行控制器项目 v2"));
|
||||
QCOMPARE(updated->deadline.value(), deadline.addDays(7));
|
||||
|
||||
ScheduleService reloaded(*context.store, QStringLiteral("test-device"));
|
||||
QCOMPARE(reloaded.projects().size(), 1);
|
||||
|
||||
QVERIFY2(context.service->setProjectStatus(id, QStringLiteral("done"), &error), qPrintable(error));
|
||||
QVERIFY(context.service->projects().isEmpty());
|
||||
QCOMPARE(context.store->outboxCount() > 0, true);
|
||||
|
||||
QVERIFY2(context.service->deleteProject(id, &error), qPrintable(error));
|
||||
QVERIFY(!context.service->projectById(id).has_value());
|
||||
}
|
||||
|
||||
QTEST_GUILESS_MAIN(TestServices)
|
||||
#include "test_services.moc"
|
||||
|
||||
Reference in New Issue
Block a user