Nathan.fooo 6bb1c4e89c
feat: run rustfmt with custom defined fmt configuration (#1848)
* chore: update rustfmt

* chore: apply rustfmt format
2023-02-13 09:29:49 +08:00

91 lines
2.0 KiB
Rust

use crate::client_folder::script::FolderNodePadScript::*;
use crate::client_folder::script::FolderNodePadTest;
#[test]
fn client_folder_create_multi_workspaces_test() {
let mut test = FolderNodePadTest::new();
test.run_scripts(vec![
AssertPathOfWorkspace {
id: "1".to_string(),
expected_path: vec![0, 0, 0].into(),
},
CreateWorkspace {
id: "a".to_string(),
name: "workspace a".to_string(),
},
AssertPathOfWorkspace {
id: "a".to_string(),
expected_path: vec![0, 0, 1].into(),
},
CreateWorkspace {
id: "b".to_string(),
name: "workspace b".to_string(),
},
AssertPathOfWorkspace {
id: "b".to_string(),
expected_path: vec![0, 0, 2].into(),
},
AssertNumberOfWorkspace { expected: 3 },
// The path of the workspace 'b' will be changed after deleting the 'a' workspace.
DeleteWorkspace {
id: "a".to_string(),
},
AssertPathOfWorkspace {
id: "b".to_string(),
expected_path: vec![0, 0, 1].into(),
},
]);
}
#[test]
fn client_folder_create_app_test() {
let mut test = FolderNodePadTest::new();
test.run_scripts(vec![
CreateApp {
id: "1".to_string(),
name: "my first app".to_string(),
},
AssertAppContent {
id: "1".to_string(),
name: "my first app".to_string(),
},
]);
}
#[test]
fn client_folder_delete_app_test() {
let mut test = FolderNodePadTest::new();
test.run_scripts(vec![
CreateApp {
id: "1".to_string(),
name: "my first app".to_string(),
},
DeleteApp {
id: "1".to_string(),
},
AssertApp {
id: "1".to_string(),
expected: None,
},
]);
}
#[test]
fn client_folder_update_app_test() {
let mut test = FolderNodePadTest::new();
test.run_scripts(vec![
CreateApp {
id: "1".to_string(),
name: "my first app".to_string(),
},
UpdateApp {
id: "1".to_string(),
name: "TODO".to_string(),
},
AssertAppContent {
id: "1".to_string(),
name: "TODO".to_string(),
},
]);
}