Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use TestRenderer instead of ShallowRenderer
- Loading branch information
1 parent
627d8a2
commit 528ef6e
Showing
35 changed files
with
504 additions
and
477 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
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
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
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
32 changes: 16 additions & 16 deletions
32
showcase/src/test/scala/scommons/client/showcase/table/TablePanelDemoSpec.scala
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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
package scommons.client.showcase.table | ||
|
||
import scommons.client.showcase.table.TablePanelDemo._ | ||
import scommons.react._ | ||
import scommons.react.test.TestSpec | ||
import scommons.react.test.util.ShallowRendererUtils | ||
import scommons.react.test._ | ||
|
||
class TablePanelDemoSpec extends TestSpec with ShallowRendererUtils { | ||
class TablePanelDemoSpec extends TestSpec with TestRendererUtils { | ||
|
||
TablePanelDemo.simpleTablePanel = () => "SimpleTablePanel".asInstanceOf[ReactClass] | ||
TablePanelDemo.customTablePanel = () => "CustomTablePanel".asInstanceOf[ReactClass] | ||
|
||
it should "render component" in { | ||
//given | ||
val component = <(TablePanelDemo())()() | ||
|
||
//when | ||
val result = shallowRender(component) | ||
val result = createTestRenderer(component).root | ||
|
||
//then | ||
assertNativeComponent(result, | ||
<.>()( | ||
<.h2()("TablePanel"), | ||
<.p()("Demonstrates table functionality"), | ||
|
||
<.h3()("Simple TablePanel"), | ||
<(SimpleTablePanel()).empty, | ||
|
||
<.h3()("TablePanel with custom cell renderer"), | ||
<(CustomTablePanel()).empty | ||
) | ||
) | ||
inside(result.children.toList) { | ||
case List(header1, p, header2, simpleTable, header3, customTable) => | ||
assertNativeComponent(header1, <.h2()("TablePanel")) | ||
assertNativeComponent(p, <.p()("Demonstrates table functionality")) | ||
assertNativeComponent(header2, <.h3()("Simple TablePanel")) | ||
assertNativeComponent(simpleTable, <(simpleTablePanel()).empty) | ||
assertNativeComponent(header3, <.h3()("TablePanel with custom cell renderer")) | ||
assertNativeComponent(customTable, <(customTablePanel()).empty) | ||
} | ||
} | ||
} |
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.