Skip to content

Commit 011afcb

Browse files
mbartaclaude
andcommitted
Add test coverage for non-HTTP scheme locations
The tel:, sms: and custom scheme cases also guard the fix when running on the JVM: the desktop JDK bundles a mailto protocol handler, so the mailto case alone would pass even without the fix. Android's libcore has no mailto handler and throws for all of these schemes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 819b686 commit 011afcb

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

core/src/test/kotlin/dev/hotwire/core/turbo/config/PathConfigurationTest.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ class PathConfigurationTest : BaseRepositoryTest() {
201201
assertThat(pathConfiguration.properties("$url/new").pullToRefreshEnabled).isFalse
202202
}
203203

204+
@Test
205+
fun unknownSchemeLocationDoesNotThrow() {
206+
assertThat(pathConfiguration.properties("mailto:test@example.com")).isNotNull
207+
assertThat(pathConfiguration.properties("tel:+15551234567")).isNotNull
208+
assertThat(pathConfiguration.properties("sms:+15551234567")).isNotNull
209+
assertThat(pathConfiguration.properties("custom-app://feature")).isNotNull
210+
}
211+
204212
@Test
205213
fun customProperties() {
206214
assertThat((pathConfiguration.properties("$url/custom/tabs").getTabs()?.size)).isEqualTo(1)

0 commit comments

Comments
 (0)