test: use Displayname instead of ShowEmails for config cache test

ShowEmails is gonig to be removed.
This commit is contained in:
link2xt
2025-12-18 20:29:11 +00:00
committed by l
parent ba8c39ff5b
commit 8bc84e13de

View File

@@ -602,10 +602,7 @@ async fn test_get_next_msgs() -> Result<()> {
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] #[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_cache_is_cleared_when_io_is_started() -> Result<()> { async fn test_cache_is_cleared_when_io_is_started() -> Result<()> {
let alice = TestContext::new_alice().await; let alice = TestContext::new_alice().await;
assert_eq!( assert_eq!(alice.get_config(Config::Displayname).await?, None);
alice.get_config(Config::ShowEmails).await?,
Some("2".to_string())
);
// Change the config circumventing the cache // Change the config circumventing the cache
// This simulates what the notification plugin on iOS might do // 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 alice
.sql .sql
.execute( .execute(
"INSERT OR REPLACE INTO config (keyname, value) VALUES ('show_emails', '0')", "INSERT OR REPLACE INTO config (keyname, value) VALUES ('displayname', 'Alice 2')",
(), (),
) )
.await?; .await?;
// Alice's Delta Chat doesn't know about it yet: // Alice's Delta Chat doesn't know about it yet:
assert_eq!( assert_eq!(alice.get_config(Config::Displayname).await?, None);
alice.get_config(Config::ShowEmails).await?,
Some("2".to_string())
);
// Starting IO will fail of course because no server settings are configured, // Starting IO will fail of course because no server settings are configured,
// but it should invalidate the caches: // but it should invalidate the caches:
alice.start_io().await; alice.start_io().await;
assert_eq!( assert_eq!(
alice.get_config(Config::ShowEmails).await?, alice.get_config(Config::Displayname).await?,
Some("0".to_string()) Some("Alice 2".to_string())
); );
Ok(()) Ok(())