From 7bc6f107dfccbea3d06ddfb3a9528c658fb8eb33 Mon Sep 17 00:00:00 2001 From: link2xt Date: Thu, 18 Dec 2025 20:29:11 +0000 Subject: [PATCH] test: use Displayname instead of ShowEmails for config cache test ShowEmails is gonig to be removed. --- src/context/context_tests.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/context/context_tests.rs b/src/context/context_tests.rs index 4a20c3af3..7f026a04f 100644 --- a/src/context/context_tests.rs +++ b/src/context/context_tests.rs @@ -602,10 +602,7 @@ async fn test_get_next_msgs() -> Result<()> { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_cache_is_cleared_when_io_is_started() -> Result<()> { let alice = TestContext::new_alice().await; - assert_eq!( - alice.get_config(Config::ShowEmails).await?, - Some("2".to_string()) - ); + assert_eq!(alice.get_config(Config::Displayname).await?, None); // Change the config circumventing the cache // This simulates what the notification plugin on iOS might do @@ -613,24 +610,21 @@ async fn test_cache_is_cleared_when_io_is_started() -> Result<()> { alice .sql .execute( - "INSERT OR REPLACE INTO config (keyname, value) VALUES ('show_emails', '0')", + "INSERT OR REPLACE INTO config (keyname, value) VALUES ('displayname', 'Alice 2')", (), ) .await?; // Alice's Delta Chat doesn't know about it yet: - assert_eq!( - alice.get_config(Config::ShowEmails).await?, - Some("2".to_string()) - ); + assert_eq!(alice.get_config(Config::Displayname).await?, None); // Starting IO will fail of course because no server settings are configured, // but it should invalidate the caches: alice.start_io().await; assert_eq!( - alice.get_config(Config::ShowEmails).await?, - Some("0".to_string()) + alice.get_config(Config::Displayname).await?, + Some("Alice 2".to_string()) ); Ok(())