use crate::test_support::window::{pinned, seated, workspace};
use crate::ui::{Channel, Chunk, Enrolling, Model, Unmaking};
mod bar;
mod column;
mod covered;
use column::{asked_world, docked, noticed, tabbed};
use covered::{
assigning, ball_amending, ball_filing, board, clearing_trail, clients, commands, config,
doctor, dropped, find, fleet, login, prices, queue, records, settings, trail, tuning,
};
pub(crate) struct World {
pub(crate) name: &'static str,
pub(crate) model: Model,
}
fn unprovisioned() -> World {
let scratch = crate::test_support::Scratch::new();
World {
name: "unprovisioned",
model: Model {
roster: crate::seat::channels(scratch.path()),
..Model::default()
},
}
}
fn working() -> World {
World {
name: "seated",
model: seated(),
}
}
fn beginning() -> World {
let mut model = seated();
model.conversation = None;
model.transcript = crate::reply::transcript::Transcript::default();
World {
name: "beginning",
model,
}
}
fn enrolling() -> World {
let mut model = seated();
let aim = model
.aim
.clone()
.unwrap_or_else(|| panic!("the seated fixture is aimed at a workspace"));
model.enroll = Some(Enrolling::at(aim));
World {
name: "enrolling",
model,
}
}
fn accordion() -> World {
let mut model = seated();
model.roster.push(Chunk {
channel: Channel {
name: "lab".to_owned(),
named_there: None,
dials: Some("127.0.0.1:7737".to_owned()),
},
held: crate::ui::Held::Heard,
workspaces: vec![workspace("bench"), workspace("annex")],
..Chunk::default()
});
World {
name: "accordion",
model,
}
}
fn slashing() -> World {
let mut model = seated();
model.draft = crate::ui::slash::LEAD.to_string();
World {
name: "slashing",
model,
}
}
fn unpinning() -> World {
let mut model = pinned();
model.draft = crate::ui::slash::LEAD.to_string();
World {
name: "unpinning",
model,
}
}
fn switching() -> World {
let mut model = seated();
model.switching = true;
World {
name: "switching",
model,
}
}
fn pinned_workspace() -> World {
World {
name: "pinned",
model: pinned(),
}
}
fn unmaking() -> World {
let mut model = seated();
let aim = model
.aim
.clone()
.unwrap_or_else(|| panic!("the seated fixture is aimed at a workspace"));
model.unmaking = Some(Unmaking::at(aim));
World {
name: "unmaking",
model,
}
}
fn filling() -> World {
let mut model = seated();
let conversation = model
.conversation
.clone()
.unwrap_or_else(|| panic!("the seated fixture has a conversation selected"));
model.fill_in(&conversation, crate::ui::Fill::Arming);
World {
name: "filling",
model,
}
}
pub(crate) fn all() -> Vec<World> {
vec![
unprovisioned(),
working(),
beginning(),
enrolling(),
tuning(),
assigning(),
records(),
queue(),
trail(),
clearing_trail(),
board(),
ball_filing(),
ball_amending(),
fleet(),
commands(),
doctor(),
find(),
prices(),
login(),
clients(),
config(),
settings(),
accordion(),
pinned_workspace(),
slashing(),
unpinning(),
switching(),
dropped(),
asked_world(),
docked(),
tabbed(),
noticed(),
unmaking(),
filling(),
bar::opened(),
bar::footed(),
]
}