Fix tests
This commit is contained in:
2024-10-17 10:21:19 +02:00
parent f64df41df8
commit 399390d737
10 changed files with 28 additions and 38 deletions
+3 -4
View File
@@ -2,10 +2,9 @@
TEST(UI_textbox, to_from_json)
{
UI_textbox textbox(std::string("textbox"), std::string("hint"), Color(0, 0, 0), Color(255, 255, 255));
json j = textbox.to_json();
UI_textbox textbox("hint", Color(0, 0, 0), Color(255, 255, 255));
json j = textbox.to_json(0);
UI_textbox textbox2(j);
EXPECT_EQ(textbox.id(), textbox2.id());
EXPECT_EQ(textbox.text(), textbox2.text());
EXPECT_EQ(textbox.fg_color(), textbox2.fg_color());
EXPECT_EQ(textbox.bg_color(), textbox2.bg_color());
@@ -14,7 +13,7 @@ TEST(UI_textbox, to_from_json)
TEST(UI_textbox, set_text)
{
UI_textbox textbox(std::string("textbox"), std::string("hint"), Color(0, 0, 0), Color(255, 255, 255));
UI_textbox textbox("hint", Color(0, 0, 0), Color(255, 255, 255));
EXPECT_EQ(textbox.text(), "");
textbox.set_text("random text");
EXPECT_EQ(textbox.text(), "random text");