Plan document file saves in app core
This commit is contained in:
@@ -371,6 +371,18 @@ if(TARGET pano_cli)
|
||||
LABELS "app;integration;desktop-fast;fuzz"
|
||||
)
|
||||
|
||||
add_test(NAME pano_cli_plan_document_file_save_now_smoke
|
||||
COMMAND pano_cli plan-document-file --work-dir D:/Paint --name demo)
|
||||
set_tests_properties(pano_cli_plan_document_file_save_now_smoke PROPERTIES
|
||||
LABELS "app;integration;desktop-fast"
|
||||
PASS_REGULAR_EXPRESSION "\"command\":\"plan-document-file\".*\"name\":\"demo\".*\"directory\":\"D:/Paint\".*\"path\":\"D:/Paint/demo.ppi\".*\"exists\":false.*\"decision\":\"save-now\"")
|
||||
|
||||
add_test(NAME pano_cli_plan_document_file_overwrite_smoke
|
||||
COMMAND pano_cli plan-document-file --work-dir D:/Paint --name demo --target-exists)
|
||||
set_tests_properties(pano_cli_plan_document_file_overwrite_smoke PROPERTIES
|
||||
LABELS "app;integration;desktop-fast"
|
||||
PASS_REGULAR_EXPRESSION "\"command\":\"plan-document-file\".*\"path\":\"D:/Paint/demo.ppi\".*\"exists\":true.*\"decision\":\"prompt-overwrite\"")
|
||||
|
||||
add_test(NAME pano_cli_simulate_app_session_clean_smoke
|
||||
COMMAND pano_cli simulate-app-session)
|
||||
set_tests_properties(pano_cli_simulate_app_session_clean_smoke PROPERTIES
|
||||
|
||||
@@ -115,6 +115,34 @@ void workflow_with_dirty_canvas_prompts_for_save(pp::tests::Harness& harness)
|
||||
== pp::app::DocumentWorkflowDecision::prompt_save_before_continue);
|
||||
}
|
||||
|
||||
void document_file_target_rejects_empty_name(pp::tests::Harness& harness)
|
||||
{
|
||||
const auto target = pp::app::make_document_file_target("D:/Paint", "");
|
||||
PP_EXPECT(harness, !target);
|
||||
PP_EXPECT(harness, target.status().code == pp::foundation::StatusCode::invalid_argument);
|
||||
}
|
||||
|
||||
void document_file_target_builds_legacy_ppi_path(pp::tests::Harness& harness)
|
||||
{
|
||||
const auto target = pp::app::make_document_file_target("D:/Paint", "demo");
|
||||
PP_EXPECT(harness, target);
|
||||
PP_EXPECT(harness, target.value().name == "demo");
|
||||
PP_EXPECT(harness, target.value().directory == "D:/Paint");
|
||||
PP_EXPECT(harness, target.value().path == "D:/Paint/demo.ppi");
|
||||
}
|
||||
|
||||
void document_file_write_prompts_only_for_existing_targets(pp::tests::Harness& harness)
|
||||
{
|
||||
PP_EXPECT(
|
||||
harness,
|
||||
pp::app::plan_document_file_write(false)
|
||||
== pp::app::DocumentFileWriteDecision::save_now);
|
||||
PP_EXPECT(
|
||||
harness,
|
||||
pp::app::plan_document_file_write(true)
|
||||
== pp::app::DocumentFileWriteDecision::prompt_overwrite);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main()
|
||||
@@ -131,5 +159,8 @@ int main()
|
||||
harness.run("workflow without canvas is unavailable", workflow_without_canvas_is_unavailable);
|
||||
harness.run("workflow with clean canvas continues now", workflow_with_clean_canvas_continues_now);
|
||||
harness.run("workflow with dirty canvas prompts for save", workflow_with_dirty_canvas_prompts_for_save);
|
||||
harness.run("document file target rejects empty name", document_file_target_rejects_empty_name);
|
||||
harness.run("document file target builds legacy ppi path", document_file_target_builds_legacy_ppi_path);
|
||||
harness.run("document file write prompts only for existing targets", document_file_write_prompts_only_for_existing_targets);
|
||||
return harness.finish();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user