aws credential deletion
This commit is contained in:
1 parent
21efa29fdd
commit
ce8727ee9a
4 files changed
+114
-3
No files matched your search
+32
@@ -401,4 +401,36 @@ mod tests {
|
||||
assert_eq!(creds[0].secret_access_key, "EXAMPLESECRET");
|
||||
assert!(creds[0].is_default);
|
||||
}
|
||||
|
||||
#[gpui_kit::test]
|
||||
fn test_delete_aws_credential(cx: &mut TestAppContext) {
|
||||
let env = TestEnv::new().unwrap();
|
||||
let cred = AwsCredential {
|
||||
id: Uuid::new_v4(),
|
||||
name: "work".into(),
|
||||
access_key_id: "AKIAEXAMPLE".into(),
|
||||
secret_access_key: "EXAMPLESECRET".into(),
|
||||
is_default: false,
|
||||
};
|
||||
env.db().unwrap().save_aws_credential(&cred).unwrap();
|
||||
let window = open_app(&env, cx);
|
||||
fill(window, "passphrase", TEST_PASSPHRASE, cx);
|
||||
click(window, "submit", cx);
|
||||
click(window, "credentials", cx);
|
||||
|
||||
click(window, "delete-work", cx);
|
||||
click(window, "aws-delete-cancel", cx);
|
||||
assert!(is_visible(window, "work", cx));
|
||||
|
||||
click(window, "delete-work", cx);
|
||||
click(window, "aws-delete-confirm", cx);
|
||||
assert_eq!(error_message(window, cx), None);
|
||||
assert!(!is_visible(window, "work", cx));
|
||||
|
||||
let creds = cx.read(|cx| {
|
||||
let AppSession::Unlocked(db) = cx.global::<AppSession>() else { panic!("locked") };
|
||||
db.list_aws_credentials().unwrap()
|
||||
});
|
||||
assert!(creds.is_empty());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user