Skip to content

Commit

Permalink
fixing use of new testing library react sugar
Browse files Browse the repository at this point in the history
  • Loading branch information
robertfmurdock committed Jul 5, 2023
1 parent 8f9260f commit 1bfc417
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import com.zegreatrob.coupling.client.components.pin.PinButton
import com.zegreatrob.coupling.model.pin.Pin
import com.zegreatrob.minassert.assertIsEqualTo
import com.zegreatrob.testmints.setup
import com.zegreatrob.wrapper.testinglibrary.react.TestingLibraryReact
import com.zegreatrob.wrapper.testinglibrary.react.render
import com.zegreatrob.wrapper.testinglibrary.react.TestingLibraryReact.render
import kotlinx.dom.hasClass
import org.w3c.dom.Element
import kotlin.test.Test
Expand All @@ -16,7 +15,7 @@ class PinButtonTest {
fun whenGivenPinWithSimpleIconWillUseStandardFontAwesomeTag() = setup(object {
val pin = Pin(icon = "angry")
}) exercise {
TestingLibraryReact.render { PinButton(pin, onClick = {}) }
render { PinButton(pin, onClick = {}) }
} verify { wrapper ->
wrapper.baseElement.getElementsByTagName("i").item(0)
.assertIconHasClasses("fa", "fa-angry")
Expand All @@ -26,7 +25,7 @@ class PinButtonTest {
fun whenGivenPinWithAlreadyDecoratedIconWillUseStandardFontAwesomeTag() = setup(object {
val pin = Pin(icon = "fa-angry")
}) exercise {
TestingLibraryReact.render { PinButton(pin, onClick = {}) }
render { PinButton(pin, onClick = {}) }
} verify { wrapper ->
wrapper.baseElement.getElementsByTagName("i").item(0)
.assertIconHasClasses("fa", "fa-angry")
Expand All @@ -36,7 +35,7 @@ class PinButtonTest {
fun whenGivenPinWithFullyDecoratedIconWillUseStandardFontAwesomeTag() = setup(object {
val pin = Pin(icon = "far fa-angry")
}) exercise {
TestingLibraryReact.render { PinButton(pin, onClick = {}) }
render { PinButton(pin, onClick = {}) }
} verify { wrapper ->
wrapper.baseElement.getElementsByTagName("i").item(0)
.assertIconHasClasses("far", "fa-angry")
Expand Down

0 comments on commit 1bfc417

Please sign in to comment.