Skip to content

Commit 8511ba3

Browse files
authored
Improve test coverage for metadata output of AppShortcutsProvider in AppIntent tests (#2907)
1 parent c4fcd9c commit 8511ba3

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

test/starlark_tests/ios_application_tests.bzl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,9 +893,11 @@ def ios_application_test_suite(name):
893893
target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_app_intents",
894894
text_test_file = "$BUNDLE_ROOT/Metadata.appintents/extract.actionsdata",
895895
text_test_values = [
896-
".*HelloWorldIntent.*",
896+
".*\"identifier\":\"HelloWorldIntent\".*",
897897
".*IntelIntent.*",
898898
".*iOSIntent.*",
899+
".*TestAppShortcuts.*",
900+
".*\"actionIdentifier\":\"HelloWorldIntent\".*",
899901
],
900902
text_file_not_contains = [
901903
".*ArmIntent.*",
@@ -911,9 +913,11 @@ def ios_application_test_suite(name):
911913
target_under_test = "//test/starlark_tests/targets_under_test/ios:app_with_app_intents",
912914
text_test_file = "$BUNDLE_ROOT/Metadata.appintents/extract.actionsdata",
913915
text_test_values = [
914-
".*HelloWorldIntent.*",
916+
".*\"identifier\":\"HelloWorldIntent\".*",
915917
".*ArmIntent.*",
916918
".*iOSIntent.*",
919+
".*TestAppShortcuts.*",
920+
".*\"actionIdentifier\":\"HelloWorldIntent\".*",
917921
],
918922
text_file_not_contains = [
919923
".*IntelIntent.*",

test/starlark_tests/resources/app_intent.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,16 @@ struct HelloWorldIntent: AppIntent {
9696
}
9797
}
9898
#endif
99+
100+
struct TestAppShortcuts: AppShortcutsProvider {
101+
static var appShortcuts: [AppShortcut] {
102+
AppShortcut(
103+
intent: HelloWorldIntent(),
104+
phrases: [
105+
"Run hello world in \(.applicationName)",
106+
],
107+
shortTitle: "Run HelloWorld Intent",
108+
systemImageName: "1.circle"
109+
)
110+
}
111+
}

0 commit comments

Comments
 (0)