tests: add test for TrelloBoards::find_by_name()
Some checks failed
Test / build (map[name:nightly]) (push) Successful in 2m38s
Test / build (map[name:stable]) (push) Successful in 2m13s
Release Please / Release-plz (push) Failing after 18s

This commit is contained in:
Paul Campbell 2024-12-15 17:15:10 +00:00
parent 20e3c80da2
commit e45c5a6ef8
2 changed files with 34 additions and 1 deletions

View file

@ -2,3 +2,33 @@
use super::*;
mod get;
#[test]
fn when_board_is_in_list_find_succeeds() {
//given
let board_name: TrelloBoardName = s!("name-1").into();
let board = TrelloBoard {
id: s!("id-1").into(),
name: board_name.clone(),
lists: vec![],
};
let boards = vec![
TrelloBoard {
id: s!("id-2").into(),
name: s!("name-2").into(),
lists: vec![],
},
board.clone(),
TrelloBoard {
id: s!("id-3").into(),
name: s!("name-3").into(),
lists: vec![],
},
];
//when
let result = boards.find_by_name(&board_name);
//then
assert_eq!(result, Some(&board));
}

View file

@ -18,7 +18,10 @@ use crate::{
board::TrelloBoardCommand,
card::TrelloCardCommand,
member::TrelloMemberCommand,
model::{TrelloBoardId, TrelloCardId},
model::{
board::{TrelloBoard, TrelloBoards},
TrelloBoardId, TrelloBoardName, TrelloCardId,
},
stack::TrelloStackCommand,
TrelloCommand, TrelloConfig,
},