mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
WTF-400 Make ChecklistItem tests pass again
This commit is contained in:
parent
b855b9bee2
commit
03e186a0cc
@ -24,6 +24,8 @@ func NewChecklistItem(checked bool, text string, checkedIcon, uncheckedIcon stri
|
||||
|
||||
// CheckMark returns the string used to indicate a ChecklistItem is checked or unchecked
|
||||
func (item *ChecklistItem) CheckMark() string {
|
||||
item.ensureItemIcons()
|
||||
|
||||
if item.Checked {
|
||||
return item.CheckedIcon
|
||||
}
|
||||
@ -36,3 +38,15 @@ func (item *ChecklistItem) CheckMark() string {
|
||||
func (item *ChecklistItem) Toggle() {
|
||||
item.Checked = !item.Checked
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (item *ChecklistItem) ensureItemIcons() {
|
||||
if item.CheckedIcon == "" {
|
||||
item.CheckedIcon = "x"
|
||||
}
|
||||
|
||||
if item.UncheckedIcon == "" {
|
||||
item.UncheckedIcon = " "
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user