Skip to content

Commit

Permalink
test(label) Add test for label recoloring
Browse files Browse the repository at this point in the history
  • Loading branch information
C47D committed Oct 1, 2024
1 parent 04b0a52 commit 48cb59b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Binary file added tests/ref_imgs/widgets/label_recolor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions tests/src/test_cases/widgets/test_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,4 +615,15 @@ void test_label_max_width(void)
TEST_ASSERT_EQUAL_SCREENSHOT("widgets/label_max_width.png");
}

void test_label_with_recolor_cmd(void)
{
lv_obj_clean(lv_screen_active());

lv_obj_t * label_recolor = lv_label_create(lv_screen_active());
lv_label_set_text(label_recolor, "Write a #ff0000 red# word");
lv_label_set_recolor(label_recolor, true);

TEST_ASSERT_EQUAL_SCREENSHOT("widgets/label_recolor.png");
}

#endif

0 comments on commit 48cb59b

Please sign in to comment.