Added support for calendar colors

This commit is contained in:
daladim 2021-07-08 15:57:45 +02:00
parent 2b339a7aff
commit 17716575d8
11 changed files with 198 additions and 27 deletions

View file

@ -50,14 +50,15 @@ async fn show_calendars() {
}
#[tokio::test]
#[ignore]
async fn create_cal() {
let _ = env_logger::builder().is_test(true).try_init();
let mut client = Client::new(URL, USERNAME, PASSWORD).unwrap();
let id: Url = kitchen_fridge::settings::EXAMPLE_CREATED_CALENDAR_URL.parse().unwrap();
let name = "prout".into();
let name = "a created calendar".into();
let supported_components = SupportedComponents::TODO;
client.create_calendar(id, name, supported_components).await.unwrap();
client.create_calendar(id, name, supported_components, Some(csscolorparser::parse("gold").unwrap())).await.unwrap();
}
#[tokio::test]

View file

@ -692,11 +692,13 @@ async fn get_or_insert_calendar(source: &mut Cache, id: &CalendarId)
None => {
let new_name = format!("Test calendar for ID {}", id);
let supported_components = SupportedComponents::TODO;
let color = csscolorparser::parse("#ff8000"); // TODO: we should rather have specific colors, depending on the calendars
source.create_calendar(
id.clone(),
new_name.to_string(),
supported_components,
None,
).await
}
}