Skip to content

Commit 87ec1d9

Browse files
committed
fixed tests
1 parent 22f9438 commit 87ec1d9

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

plugins/core/jetbrains-community/tst/software/aws/toolkits/jetbrains/core/notifications/NotificationManagerTest.kt

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,37 @@
33

44
package software.aws.toolkits.jetbrains.core.notifications
55

6+
import com.intellij.testFramework.ApplicationExtension
7+
import com.intellij.testFramework.ProjectRule
68
import org.assertj.core.api.Assertions.assertThat
9+
import org.junit.Rule
710
import org.junit.jupiter.api.Test
11+
import org.junit.jupiter.api.extension.ExtendWith
812

13+
@ExtendWith(ApplicationExtension::class)
914
class NotificationManagerTest {
15+
@Rule
16+
@JvmField
17+
val projectRule = ProjectRule()
1018

1119
@Test
1220
fun `If no follow-up actions, expand action is present`() {
13-
val sut = NotificationManager.createActions(null, "Dummy Test Action", "Dummy title")
21+
val sut = NotificationManager.createActions(projectRule.project, listOf(), "Dummy Test Action", "Dummy title")
1422
assertThat(sut).isNotNull
1523
assertThat(sut).hasSize(1)
16-
assertThat(sut.first().title).isEqualTo("Expand")
24+
assertThat(sut.first().title).isEqualTo("More...")
1725
}
1826

1927
@Test
2028
fun `Show Url action shows the option to learn more`() {
2129
val followupActions = NotificationFollowupActions(
22-
"ShowUrl",
23-
NotificationFollowupActionsContent(NotificationActionDescription("title", "http://leadsnowhere"))
30+
"UpdateExtension",
31+
NotificationFollowupActionsContent(NotificationActionDescription("title", null))
2432
)
25-
val sut = NotificationManager.createActions(listOf(followupActions), "Dummy Test Action", "Dummy title")
33+
val sut = NotificationManager.createActions(projectRule.project,listOf(followupActions), "Dummy Test Action", "Dummy title")
2634
assertThat(sut).isNotNull
2735
assertThat(sut).hasSize(2)
28-
assertThat(sut.first().title).isEqualTo("Expand")
29-
assertThat(sut[1].title).isEqualTo("Learn more")
36+
assertThat(sut.first().title).isEqualTo("Update")
37+
assertThat(sut[1].title).isEqualTo("More...")
3038
}
3139
}

0 commit comments

Comments
 (0)