mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 01:33:19 +00:00
Don't show the '#' before tags in the UI
This commit is contained in:
parent
e18691d72c
commit
6ca786a4f6
3 changed files with 34 additions and 16 deletions
|
@ -11,17 +11,34 @@
|
|||
#include "core/TodoMd.h"
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
TEST_CASE("TODO make tests", "[todo]")
|
||||
TEST_CASE("Creating task from string")
|
||||
{
|
||||
mirai::Mirai mirai;
|
||||
auto task = mirai::TodoMdFormat::StringToTask(
|
||||
"- [X] 08:00-10:00 > This is a test -- #mirai", "2024-04-19"
|
||||
);
|
||||
REQUIRE(task.date == "2024-04-19");
|
||||
REQUIRE(task.tags.size() == 1);
|
||||
REQUIRE(task.tags[0] == "#mirai");
|
||||
REQUIRE(task.text == "This is a test");
|
||||
REQUIRE(task.state == mirai::DONE);
|
||||
REQUIRE(task.startTime == "08:00");
|
||||
REQUIRE(task.endTime == "10:00");
|
||||
SECTION("Task with all properties")
|
||||
{
|
||||
auto task = mirai::TodoMdFormat::StringToTask(
|
||||
"- [X] 08:00-10:00 > This is a test -- #mirai", "2024-04-19"
|
||||
);
|
||||
REQUIRE(task.date == "2024-04-19");
|
||||
REQUIRE(task.tags.size() == 1);
|
||||
REQUIRE(task.tags[0] == "mirai");
|
||||
REQUIRE(task.text == "This is a test");
|
||||
REQUIRE(task.state == mirai::DONE);
|
||||
REQUIRE(task.startTime == "08:00");
|
||||
REQUIRE(task.endTime == "10:00");
|
||||
}
|
||||
|
||||
SECTION("Task with all properties 2")
|
||||
{
|
||||
auto task = mirai::TodoMdFormat::StringToTask(
|
||||
"- [ ] 09:00-17:00 > This is another test -- #mirai #feature", "2024-04-20"
|
||||
);
|
||||
REQUIRE(task.date == "2024-04-20");
|
||||
REQUIRE(task.tags.size() == 2);
|
||||
REQUIRE(task.tags[0] == "mirai");
|
||||
REQUIRE(task.tags[1] == "feature");
|
||||
REQUIRE(task.text == "This is another test");
|
||||
REQUIRE(task.state == mirai::TODO);
|
||||
REQUIRE(task.startTime == "09:00");
|
||||
REQUIRE(task.endTime == "17:00");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue