mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 17:57:19 +02:00
Merge pull request #195 from kdheepak/add-default-report-command-line-argument
Fix tests
This commit is contained in:
commit
547d9ef31e
1 changed files with 20 additions and 20 deletions
40
src/app.rs
40
src/app.rs
|
@ -2872,14 +2872,14 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_taskwarrior_tui() {
|
fn test_taskwarrior_tui() {
|
||||||
let app = TaskwarriorTuiApp::new();
|
let app = TaskwarriorTuiApp::new("next");
|
||||||
if let Err(_) = app {
|
if let Err(_) = app {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let app = app.unwrap();
|
let app = app.unwrap();
|
||||||
assert!(app.task_by_index(0).is_none());
|
assert!(app.task_by_index(0).is_none());
|
||||||
|
|
||||||
let app = TaskwarriorTuiApp::new().unwrap();
|
let app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
assert!(app
|
assert!(app
|
||||||
.task_by_uuid(Uuid::parse_str("3f43831b-88dc-45e2-bf0d-4aea6db634cc").unwrap())
|
.task_by_uuid(Uuid::parse_str("3f43831b-88dc-45e2-bf0d-4aea6db634cc").unwrap())
|
||||||
.is_none());
|
.is_none());
|
||||||
|
@ -2891,10 +2891,10 @@ mod tests {
|
||||||
|
|
||||||
setup();
|
setup();
|
||||||
|
|
||||||
let app = TaskwarriorTuiApp::new().unwrap();
|
let app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
assert!(app.task_by_index(0).is_some());
|
assert!(app.task_by_index(0).is_some());
|
||||||
|
|
||||||
let app = TaskwarriorTuiApp::new().unwrap();
|
let app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
assert!(app
|
assert!(app
|
||||||
.task_by_uuid(Uuid::parse_str("3f43831b-88dc-45e2-bf0d-4aea6db634cc").unwrap())
|
.task_by_uuid(Uuid::parse_str("3f43831b-88dc-45e2-bf0d-4aea6db634cc").unwrap())
|
||||||
.is_some());
|
.is_some());
|
||||||
|
@ -2913,7 +2913,7 @@ mod tests {
|
||||||
|
|
||||||
fn test_task_tags() {
|
fn test_task_tags() {
|
||||||
// testing tags
|
// testing tags
|
||||||
let app = TaskwarriorTuiApp::new().unwrap();
|
let app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
let task = app.task_by_id(1).unwrap();
|
let task = app.task_by_id(1).unwrap();
|
||||||
|
|
||||||
let tags = vec!["PENDING".to_string(), "PRIORITY".to_string()];
|
let tags = vec!["PENDING".to_string(), "PRIORITY".to_string()];
|
||||||
|
@ -2922,7 +2922,7 @@ mod tests {
|
||||||
assert!(task.tags().unwrap().contains(&tag));
|
assert!(task.tags().unwrap().contains(&tag));
|
||||||
}
|
}
|
||||||
|
|
||||||
let app = TaskwarriorTuiApp::new().unwrap();
|
let app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
let task = app.task_by_id(11).unwrap();
|
let task = app.task_by_id(11).unwrap();
|
||||||
let tags = vec!["finance", "UNBLOCKED", "PENDING", "TAGGED", "UDA"]
|
let tags = vec!["finance", "UNBLOCKED", "PENDING", "TAGGED", "UDA"]
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -2934,7 +2934,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_task_style() {
|
fn test_task_style() {
|
||||||
let app = TaskwarriorTuiApp::new().unwrap();
|
let app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
let task = app.task_by_id(1).unwrap();
|
let task = app.task_by_id(1).unwrap();
|
||||||
for r in vec![
|
for r in vec![
|
||||||
"active",
|
"active",
|
||||||
|
@ -2964,7 +2964,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_task_context() {
|
fn test_task_context() {
|
||||||
let mut app = TaskwarriorTuiApp::new().unwrap();
|
let mut app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
|
|
||||||
assert!(app.get_context().is_ok());
|
assert!(app.get_context().is_ok());
|
||||||
assert!(app.update(true).is_ok());
|
assert!(app.update(true).is_ok());
|
||||||
|
@ -3000,7 +3000,7 @@ mod tests {
|
||||||
fn test_task_tomorrow() {
|
fn test_task_tomorrow() {
|
||||||
let total_tasks: u64 = 26;
|
let total_tasks: u64 = 26;
|
||||||
|
|
||||||
let mut app = TaskwarriorTuiApp::new().unwrap();
|
let mut app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
assert!(app.get_context().is_ok());
|
assert!(app.get_context().is_ok());
|
||||||
assert!(app.update(true).is_ok());
|
assert!(app.update(true).is_ok());
|
||||||
assert_eq!(app.tasks.len(), total_tasks as usize);
|
assert_eq!(app.tasks.len(), total_tasks as usize);
|
||||||
|
@ -3063,7 +3063,7 @@ mod tests {
|
||||||
.output()
|
.output()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut app = TaskwarriorTuiApp::new().unwrap();
|
let mut app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
assert!(app.get_context().is_ok());
|
assert!(app.get_context().is_ok());
|
||||||
assert!(app.update(true).is_ok());
|
assert!(app.update(true).is_ok());
|
||||||
assert_eq!(app.tasks.len(), total_tasks as usize);
|
assert_eq!(app.tasks.len(), total_tasks as usize);
|
||||||
|
@ -3073,7 +3073,7 @@ mod tests {
|
||||||
fn test_task_earlier_today() {
|
fn test_task_earlier_today() {
|
||||||
let total_tasks: u64 = 26;
|
let total_tasks: u64 = 26;
|
||||||
|
|
||||||
let mut app = TaskwarriorTuiApp::new().unwrap();
|
let mut app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
assert!(app.get_context().is_ok());
|
assert!(app.get_context().is_ok());
|
||||||
assert!(app.update(true).is_ok());
|
assert!(app.update(true).is_ok());
|
||||||
assert_eq!(app.tasks.len(), total_tasks as usize);
|
assert_eq!(app.tasks.len(), total_tasks as usize);
|
||||||
|
@ -3125,7 +3125,7 @@ mod tests {
|
||||||
.output()
|
.output()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut app = TaskwarriorTuiApp::new().unwrap();
|
let mut app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
assert!(app.get_context().is_ok());
|
assert!(app.get_context().is_ok());
|
||||||
assert!(app.update(true).is_ok());
|
assert!(app.update(true).is_ok());
|
||||||
assert_eq!(app.tasks.len(), total_tasks as usize);
|
assert_eq!(app.tasks.len(), total_tasks as usize);
|
||||||
|
@ -3135,7 +3135,7 @@ mod tests {
|
||||||
fn test_task_later_today() {
|
fn test_task_later_today() {
|
||||||
let total_tasks: u64 = 26;
|
let total_tasks: u64 = 26;
|
||||||
|
|
||||||
let mut app = TaskwarriorTuiApp::new().unwrap();
|
let mut app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
assert!(app.get_context().is_ok());
|
assert!(app.get_context().is_ok());
|
||||||
assert!(app.update(true).is_ok());
|
assert!(app.update(true).is_ok());
|
||||||
assert_eq!(app.tasks.len(), total_tasks as usize);
|
assert_eq!(app.tasks.len(), total_tasks as usize);
|
||||||
|
@ -3194,7 +3194,7 @@ mod tests {
|
||||||
.output()
|
.output()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut app = TaskwarriorTuiApp::new().unwrap();
|
let mut app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
assert!(app.get_context().is_ok());
|
assert!(app.get_context().is_ok());
|
||||||
assert!(app.update(true).is_ok());
|
assert!(app.update(true).is_ok());
|
||||||
assert_eq!(app.tasks.len(), total_tasks as usize);
|
assert_eq!(app.tasks.len(), total_tasks as usize);
|
||||||
|
@ -3203,7 +3203,7 @@ mod tests {
|
||||||
|
|
||||||
fn test_draw_empty_task_report() {
|
fn test_draw_empty_task_report() {
|
||||||
let test_case = |expected: &Buffer| {
|
let test_case = |expected: &Buffer| {
|
||||||
let mut app = TaskwarriorTuiApp::new().unwrap();
|
let mut app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
|
|
||||||
app.task_report_next();
|
app.task_report_next();
|
||||||
app.context_next();
|
app.context_next();
|
||||||
|
@ -3269,7 +3269,7 @@ mod tests {
|
||||||
|
|
||||||
fn test_draw_task_report_with_extended_modify_command() {
|
fn test_draw_task_report_with_extended_modify_command() {
|
||||||
let test_case = |expected1: &Buffer, expected2: &Buffer| {
|
let test_case = |expected1: &Buffer, expected2: &Buffer| {
|
||||||
let mut app = TaskwarriorTuiApp::new().unwrap();
|
let mut app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
|
|
||||||
let total_tasks: u64 = 26;
|
let total_tasks: u64 = 26;
|
||||||
|
|
||||||
|
@ -3435,7 +3435,7 @@ mod tests {
|
||||||
|
|
||||||
fn test_draw_task_report() {
|
fn test_draw_task_report() {
|
||||||
let test_case = |expected: &Buffer| {
|
let test_case = |expected: &Buffer| {
|
||||||
let mut app = TaskwarriorTuiApp::new().unwrap();
|
let mut app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
|
|
||||||
app.task_report_next();
|
app.task_report_next();
|
||||||
app.context_next();
|
app.context_next();
|
||||||
|
@ -3591,7 +3591,7 @@ mod tests {
|
||||||
|
|
||||||
fn test_draw_calendar() {
|
fn test_draw_calendar() {
|
||||||
let test_case = |expected: &Buffer| {
|
let test_case = |expected: &Buffer| {
|
||||||
let mut app = TaskwarriorTuiApp::new().unwrap();
|
let mut app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
|
|
||||||
app.task_report_next();
|
app.task_report_next();
|
||||||
app.context_next();
|
app.context_next();
|
||||||
|
@ -3675,7 +3675,7 @@ mod tests {
|
||||||
|
|
||||||
fn test_draw_help_popup() {
|
fn test_draw_help_popup() {
|
||||||
let test_case = |expected: &Buffer| {
|
let test_case = |expected: &Buffer| {
|
||||||
let mut app = TaskwarriorTuiApp::new().unwrap();
|
let mut app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
|
|
||||||
app.mode = AppMode::TaskHelpPopup;
|
app.mode = AppMode::TaskHelpPopup;
|
||||||
app.task_report_next();
|
app.task_report_next();
|
||||||
|
@ -3721,7 +3721,7 @@ mod tests {
|
||||||
|
|
||||||
fn test_draw_context_menu() {
|
fn test_draw_context_menu() {
|
||||||
let test_case = |expected: &Buffer| {
|
let test_case = |expected: &Buffer| {
|
||||||
let mut app = TaskwarriorTuiApp::new().unwrap();
|
let mut app = TaskwarriorTuiApp::new("next").unwrap();
|
||||||
|
|
||||||
app.mode = AppMode::TaskContextMenu;
|
app.mode = AppMode::TaskContextMenu;
|
||||||
app.task_report_next();
|
app.task_report_next();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue