Plan document session prompts
This commit is contained in:
@@ -358,6 +358,43 @@ void close_request_executor_dispatches_and_preserves_wait(pp::tests::Harness& ha
|
||||
PP_EXPECT(harness, services.call_order == "close;prompt;");
|
||||
}
|
||||
|
||||
void document_session_prompt_catalog_preserves_legacy_close_and_workflow_text(pp::tests::Harness& harness)
|
||||
{
|
||||
const auto close = pp::app::plan_document_session_prompt(
|
||||
pp::app::DocumentSessionPromptKind::close_unsaved_document);
|
||||
const auto workflow = pp::app::plan_document_session_prompt(
|
||||
pp::app::DocumentSessionPromptKind::save_before_workflow_continue);
|
||||
|
||||
PP_EXPECT(harness, close.title == "Unsaved document");
|
||||
PP_EXPECT(harness, close.message == "Do you want to close without saving?");
|
||||
PP_EXPECT(harness, close.ok_caption == "Yes");
|
||||
PP_EXPECT(harness, close.cancel_caption == "No");
|
||||
PP_EXPECT(harness, close.show_cancel);
|
||||
PP_EXPECT(harness, workflow.message == "Would you like to save this document before closing?");
|
||||
PP_EXPECT(harness, workflow.ok_caption == "Yes");
|
||||
PP_EXPECT(harness, workflow.cancel_caption == "No");
|
||||
}
|
||||
|
||||
void document_session_prompt_catalog_preserves_overwrite_and_error_text(pp::tests::Harness& harness)
|
||||
{
|
||||
const auto new_doc = pp::app::plan_document_session_prompt(
|
||||
pp::app::DocumentSessionPromptKind::new_document_overwrite);
|
||||
const auto overwrite = pp::app::plan_document_session_prompt(
|
||||
pp::app::DocumentSessionPromptKind::document_file_overwrite,
|
||||
"demo");
|
||||
const auto save_error = pp::app::plan_document_session_prompt(
|
||||
pp::app::DocumentSessionPromptKind::document_save_error);
|
||||
|
||||
PP_EXPECT(harness, new_doc.title == "Warning");
|
||||
PP_EXPECT(harness, new_doc.message == "A document with this name already exists, continue?");
|
||||
PP_EXPECT(harness, new_doc.show_cancel);
|
||||
PP_EXPECT(harness, overwrite.message == "Are you sure you want to overwrite demo?");
|
||||
PP_EXPECT(harness, overwrite.show_cancel);
|
||||
PP_EXPECT(harness, save_error.title == "Saving Error");
|
||||
PP_EXPECT(harness, save_error.message == "There was a problem saving the document");
|
||||
PP_EXPECT(harness, !save_error.show_cancel);
|
||||
}
|
||||
|
||||
void save_clean_existing_document_is_no_op(pp::tests::Harness& harness)
|
||||
{
|
||||
PP_EXPECT(
|
||||
@@ -757,6 +794,12 @@ int main()
|
||||
harness.run("close clean document executes immediately", close_clean_document_executes_immediately);
|
||||
harness.run("close dirty document opens one prompt", close_dirty_document_opens_one_prompt);
|
||||
harness.run("close request executor dispatches and preserves wait", close_request_executor_dispatches_and_preserves_wait);
|
||||
harness.run(
|
||||
"document session prompt catalog preserves legacy close and workflow text",
|
||||
document_session_prompt_catalog_preserves_legacy_close_and_workflow_text);
|
||||
harness.run(
|
||||
"document session prompt catalog preserves overwrite and error text",
|
||||
document_session_prompt_catalog_preserves_overwrite_and_error_text);
|
||||
harness.run("save clean existing document is no op", save_clean_existing_document_is_no_op);
|
||||
harness.run("save executor dispatches visible work and no ops cleanly", save_executor_dispatches_visible_work_and_no_ops_cleanly);
|
||||
harness.run("save new or dirty document has user visible work", save_new_or_dirty_document_has_user_visible_work);
|
||||
|
||||
Reference in New Issue
Block a user