@@ -16,9 +16,9 @@ import androidx.compose.ui.graphics.vector.path
1616import androidx.compose.ui.unit.dp
1717import assertk.assertThat
1818import assertk.assertions.isEqualTo
19- import com.intellij.openapi.application.invokeAndWaitIfNeeded
2019import com.intellij.openapi.project.Project
2120import com.intellij.testFramework.ProjectExtension
21+ import com.intellij.testFramework.runInEdtAndGet
2222import io.github.composegears.valkyrie.parser.ktfile.common.ParseType
2323import io.github.composegears.valkyrie.parser.ktfile.common.createKtFile
2424import io.github.composegears.valkyrie.parser.ktfile.common.toKtFile
@@ -27,7 +27,6 @@ import org.junit.jupiter.api.extension.RegisterExtension
2727import org.junit.jupiter.params.ParameterizedTest
2828import org.junit.jupiter.params.provider.EnumSource
2929
30- @Suppress(" UnstableApiUsage" )
3130class KtFileToImageVectorParserTest {
3231
3332 companion object {
@@ -40,7 +39,7 @@ class KtFileToImageVectorParserTest {
4039
4140 @ParameterizedTest
4241 @EnumSource(value = ParseType ::class )
43- fun `empty image vector` (parseType : ParseType ) = invokeAndWaitIfNeeded {
42+ fun `empty image vector` (parseType : ParseType ) = runInEdtAndGet {
4443 val ktFile = parseType.toKtFile(
4544 project = project,
4645 pathToLazy = " lazy/EmptyImageVector.kt" ,
@@ -62,7 +61,7 @@ class KtFileToImageVectorParserTest {
6261
6362 @ParameterizedTest
6463 @EnumSource(value = ParseType ::class )
65- fun `empty paths` (parseType : ParseType ) = invokeAndWaitIfNeeded {
64+ fun `empty paths` (parseType : ParseType ) = runInEdtAndGet {
6665 val ktFile = parseType.toKtFile(
6766 project = project,
6867 pathToLazy = " lazy/EmptyPaths.kt" ,
@@ -87,7 +86,7 @@ class KtFileToImageVectorParserTest {
8786
8887 @ParameterizedTest
8988 @EnumSource(value = ParseType ::class )
90- fun `parse all path params` (parseType : ParseType ) = invokeAndWaitIfNeeded {
89+ fun `parse all path params` (parseType : ParseType ) = runInEdtAndGet {
9190 val ktFile = parseType.toKtFile(
9291 project = project,
9392 pathToLazy = " lazy/AllPathParams.kt" ,
@@ -142,7 +141,7 @@ class KtFileToImageVectorParserTest {
142141 }
143142
144143 @Test
145- fun `parse material icon` () = invokeAndWaitIfNeeded {
144+ fun `parse material icon` () = runInEdtAndGet {
146145 val ktFile = project.createKtFile(from = " backing/MaterialIcon.kt" )
147146 val imageVector = KtFileToImageVectorParser .parse(ktFile)
148147
@@ -162,7 +161,7 @@ class KtFileToImageVectorParserTest {
162161
163162 @ParameterizedTest
164163 @EnumSource(value = ParseType ::class )
165- fun `parse icon with group` (parseType : ParseType ) = invokeAndWaitIfNeeded {
164+ fun `parse icon with group` (parseType : ParseType ) = runInEdtAndGet {
166165 val ktFile = parseType.toKtFile(
167166 project = project,
168167 pathToLazy = " lazy/IconWithGroup.kt" ,
@@ -206,7 +205,7 @@ class KtFileToImageVectorParserTest {
206205
207206 @ParameterizedTest
208207 @EnumSource(value = ParseType ::class )
209- fun `parse icon with linear and radial gradient` (parseType : ParseType ) = invokeAndWaitIfNeeded {
208+ fun `parse icon with linear and radial gradient` (parseType : ParseType ) = runInEdtAndGet {
210209 val ktFile = parseType.toKtFile(
211210 project = project,
212211 pathToLazy = " lazy/IconWithGradient.kt" ,
@@ -277,7 +276,7 @@ class KtFileToImageVectorParserTest {
277276
278277 @ParameterizedTest
279278 @EnumSource(value = ParseType ::class )
280- fun `parse single path property` (parseType : ParseType ) = invokeAndWaitIfNeeded {
279+ fun `parse single path property` (parseType : ParseType ) = runInEdtAndGet {
281280 val ktFile = parseType.toKtFile(
282281 project = project,
283282 pathToLazy = " lazy/SinglePath.kt" ,
@@ -315,7 +314,7 @@ class KtFileToImageVectorParserTest {
315314
316315 @ParameterizedTest
317316 @EnumSource(value = ParseType ::class )
318- fun `parse all group params` (parseType : ParseType ) = invokeAndWaitIfNeeded {
317+ fun `parse all group params` (parseType : ParseType ) = runInEdtAndGet {
319318 val ktFile = parseType.toKtFile(
320319 project = project,
321320 pathToLazy = " imagevector/kt/lazy/AllGroupParams.kt" ,
@@ -385,7 +384,7 @@ class KtFileToImageVectorParserTest {
385384
386385 @ParameterizedTest
387386 @EnumSource(value = ParseType ::class )
388- fun `parse gradient with clip path` (parseType : ParseType ) = invokeAndWaitIfNeeded {
387+ fun `parse gradient with clip path` (parseType : ParseType ) = runInEdtAndGet {
389388 val ktFile = parseType.toKtFile(
390389 project = project,
391390 pathToLazy = " imagevector/kt//lazy/ClipPathGradient.kt" ,
@@ -528,7 +527,7 @@ class KtFileToImageVectorParserTest {
528527
529528 @ParameterizedTest
530529 @EnumSource(value = ParseType ::class )
531- fun `parse compose color` (parseType : ParseType ) = invokeAndWaitIfNeeded {
530+ fun `parse compose color` (parseType : ParseType ) = runInEdtAndGet {
532531 val ktFile = parseType.toKtFile(
533532 project = project,
534533 pathToLazy = " imagevector/kt/lazy/ComposeColor.kt" ,
0 commit comments