forked from JetBrains/intellij-community
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JEWEL-761] Fix modifier handling in Link
We had a bug in Link where, when it was enabled, it would essentially ignore the passed in Modifier. The fix is simple, but the issue was tricky to spot, as it's quite subtle! This also: * Adds a test to avoid regressions * Restores the ui-tests module, which was removed from the Gradle build by mistake (probably during a rebase/merge) * Restores the git hook setup on non-Windows OSes (it is only broken on Windows) and proposes a solution for Windows for Kuba to test
- Loading branch information
Showing
3 changed files
with
64 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
platform/jewel/ui-tests/src/test/kotlin/org/jetbrains/jewel/ui/component/LinkUiTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.jetbrains.jewel.ui.component | ||
|
||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.platform.testTag | ||
import androidx.compose.ui.test.junit4.createComposeRule | ||
import androidx.compose.ui.test.onNodeWithTag | ||
import androidx.compose.ui.test.onNodeWithText | ||
import org.jetbrains.jewel.intui.standalone.theme.IntUiTheme | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
class LinkUiTest { | ||
@get:Rule val rule = createComposeRule() | ||
|
||
@Test | ||
fun `should apply provided modifier correctly`() { | ||
rule.setContent { IntUiTheme { Link("Whatever", {}, modifier = Modifier.testTag("123banana")) } } | ||
rule.onNodeWithText("Whatever").assertExists() | ||
rule.onNodeWithTag("123banana").assertExists() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters