Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(chore): fix lint error #330

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 11 additions & 20 deletions src/usecase/tui/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ mod test {
},
message: Some(Message::SearchTextAreaKeyInput(KeyEvent::from(
KeyCode::Backspace,
))),
))),
expect_model: Model {
app_state: AppState::SelectCommand(SelectCommandState {
commands_list_state: ListState::with_selected(
Expand Down Expand Up @@ -952,7 +952,8 @@ mod test {
},
},
Case {
title: "PreviousCommand when there is no commands to select, panic should not occur",
title: "PreviousCommand when there is no commands to select,
panic should not occur",
model: {
let mut m = Model {
app_state: AppState::SelectCommand(SelectCommandState {
Expand Down Expand Up @@ -1022,49 +1023,39 @@ mod test {
},
},
Case {
title: "When the last history is selected and NextHistory is received, it returns to the beginning.",
title: "When the last history is selected and NextHistory is received,
it returns to the beginning.",
model: Model {
app_state: AppState::SelectCommand(SelectCommandState {
current_pane: CurrentPane::History,
history_list_state: ListState::with_selected(
ListState::default(),
Some(2),
),
history_list_state: ListState::with_selected(ListState::default(), Some(2)),
..SelectCommandState::new_for_test()
}),
},
message: Some(Message::NextHistory),
expect_model: Model {
app_state: AppState::SelectCommand(SelectCommandState {
current_pane: CurrentPane::History,
history_list_state: ListState::with_selected(
ListState::default(),
Some(0),
),
history_list_state: ListState::with_selected(ListState::default(), Some(0)),
..SelectCommandState::new_for_test()
}),
},
},
Case {
title: "When the first history is selected and PreviousHistory is received, it moves to the last history.",
title: "When the first history is selected and PreviousHistory is received,
it moves to the last history.",
model: Model {
app_state: AppState::SelectCommand(SelectCommandState {
current_pane: CurrentPane::History,
history_list_state: ListState::with_selected(
ListState::default(),
Some(0),
),
history_list_state: ListState::with_selected(ListState::default(), Some(0)),
..SelectCommandState::new_for_test()
}),
},
message: Some(Message::PreviousHistory),
expect_model: Model {
app_state: AppState::SelectCommand(SelectCommandState {
current_pane: CurrentPane::History,
history_list_state: ListState::with_selected(
ListState::default(),
Some(2),
),
history_list_state: ListState::with_selected(ListState::default(), Some(2)),
..SelectCommandState::new_for_test()
}),
},
Expand Down