mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 05:16:28 +03:00
test: use Displayname instead of ShowEmails for config cache test
ShowEmails is gonig to be removed.
This commit is contained in:
@@ -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(())
|
||||||
|
|||||||
Reference in New Issue
Block a user