forked from metafates/mangal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtui_test.go
41 lines (30 loc) · 844 Bytes
/
tui_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package main
import "testing"
func TestNewBubble(t *testing.T) {
initConfig("")
bubble := NewBubble(searchState)
if bubble.state != searchState {
t.Error("Invalid state")
}
if bubble.mangaList.FilteringEnabled() {
t.Error("Filtered should be disabled for manga list")
}
if bubble.chaptersList.FilteringEnabled() {
t.Error("Filtering should be disabled for chapters list")
}
if bubble.mangaChan == nil {
t.Error("Manga channel should not be nil")
}
if bubble.chaptersChan == nil {
t.Error("Chapters channel should not be nil")
}
if bubble.chaptersProgressChan == nil {
t.Error("Chapters progress channel should not be nil")
}
if bubble.chapterPagesProgressChan == nil {
t.Error("Chapter pages progress channel should not be nil")
}
if !bubble.input.Focused() {
t.Error("Input should be focused")
}
}