Merge branch 'master' into beacon
This commit is contained in:
commit
3f67044977
62 changed files with 713 additions and 780 deletions
|
|
@ -167,3 +167,42 @@ impl Styling {
|
|||
self.theme.clone()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use rayon::prelude::*;
|
||||
|
||||
use iced_test::{Error, simulator};
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn it_showcases_every_theme() -> Result<(), Error> {
|
||||
Theme::ALL
|
||||
.par_iter()
|
||||
.cloned()
|
||||
.map(|theme| {
|
||||
let mut styling = Styling::default();
|
||||
styling.update(Message::ThemeChanged(theme));
|
||||
|
||||
let theme = styling.theme();
|
||||
|
||||
let mut ui = simulator(styling.view());
|
||||
let snapshot = ui.snapshot(&theme)?;
|
||||
|
||||
assert!(
|
||||
snapshot.matches_hash(format!(
|
||||
"snapshots/{theme}",
|
||||
theme = theme
|
||||
.to_string()
|
||||
.to_ascii_lowercase()
|
||||
.replace(" ", "_")
|
||||
))?,
|
||||
"snapshots for {theme} should match!"
|
||||
);
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue