Commit 6d49db7
committed
Re-introduce accidentally removed check in
This occurred while removing `#available(iOS 13, *)` checks a few
commits before this. I was too eager in my deletions.
See discussion at
#19513 (comment)
For the record, I started looking at how to add a unit test to catch
this issue but I run into a number of problems.
1. The code is in the WordPressShareExtension target and we cannot test
that one directly; Xcode doesn't let you create test target against
app extensions
2. Even if we could access the code, the logic depends on
`editorController`, an instance property that sets the state based
whether `Bundle.main.bundleIdentifier` contains "DraftAction". That
is something we cannot modify at test run time.
In short, to test this trivial behavior, we'll need to put in place a
far-from trivial test harness. The idea I have at the moment would be to
extract as much of the logic shared between WordPressShareExtension,
WordPressDraftActionExtension, and their two Jetpack counter parts into
a framework, which we could then test in isolation and design in such a
way that we don't need to inspect the bundle identifier at runtime.
It's worth saying that folks were aware of the code limitations at the
time of implementing the behavior but must have been pressed for time to
ship a bug fix, as evidenced by the comment in the `editorController`
implementation.MainShareViewController
1 parent 220efe0 commit 6d49db7
File tree
1 file changed
+4
-2
lines changed1 file changed
+4
-2
lines changedLines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| |||
0 commit comments