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
42
43
44
45
46
use ratatui::buffer::Buffer;
use crate::common::{reset_buffer, run_app, EventBuilder};
#[allow(dead_code)]
mod common;
#[tokio::test]
async fn test_search() {
let sync = EventBuilder::new()
.string("/one punch man")
.esc()
.string('c')
.quit()
.build();
let res = reset_buffer(&run_app(sync, 60, 22).await.unwrap());
assert_eq!(
res,
Buffer::with_lines([
"┌Search──────────────────────────────Press F1 or ? for help┐",
"│one punch man │",
"└──────────────────────────────────────────────────────────┘",
"┌Results 1-0 (0 total): Page 1/0─dl: Run Command, src: Nyaa┐",
"│ ┌Category───────────────────────┐ │",
"│ │ ▼ All Categories │ │",
"│ │ --- All Categories █ │",
"│ │ ▶ Anime █ │",
"│ │ ▶ Audio █ │",
"│ │ ▶ Literature █ │",
"│ │ ▶ Live Action █ │",
"│ │ ▶ Pictures █ │",
"│ │ ▶ Software █ │",
"│ │ │ │",
"│ │ │ │",
"│ │ │ │",
"│ │ │ │",
"│ └───────────────────────────────┘ │",
"│ │",
"│ │",
"│ │",
"└─────────────────────────────────────────────────────────c┘",
])
);
}