add sda compat unit test for no web cookie

This commit is contained in:
Carson McManus 2022-01-15 09:36:10 -05:00
parent 070be5b629
commit d21ceef797

View file

@ -482,4 +482,38 @@ mod tests {
.account_name .account_name
); );
} }
#[test]
fn test_sda_compatibility_no_webcookie() {
let path = Path::new("src/fixtures/maFiles/compat/no-webcookie/manifest.json");
assert!(path.is_file());
let result = Manifest::load(path);
assert!(matches!(result, Ok(_)));
let mut manifest = result.unwrap();
assert!(matches!(manifest.entries.last().unwrap().encryption, None));
assert!(matches!(manifest.load_accounts(&None), Ok(_)));
assert_eq!(
manifest.entries.last().unwrap().account_name,
manifest
.accounts
.last()
.unwrap()
.lock()
.unwrap()
.account_name
);
assert_eq!(
manifest
.accounts
.last()
.unwrap()
.lock()
.unwrap()
.session
.as_ref()
.unwrap()
.web_cookie,
None
);
}
} }