diff --git a/build.sbt b/build.sbt index b7c19d35..e630609d 100644 --- a/build.sbt +++ b/build.sbt @@ -1,10 +1,9 @@ import org.scalajs.linker.interface.ModuleSplitStyle -val reactJS = "16.13.1" -val scalaJsReact = "1.7.7" +val reactJS = "17.0.2" +val scalaJsReact = "2.0.0-RC2" val FUILess = "2.8.7" val reactSUI = "2.0.3" -val Toasts = "0.6.5" cancelable in Global := true @@ -87,16 +86,14 @@ lazy val facade = "react" -> reactJS, "react-dom" -> reactJS, "semantic-ui-react" -> reactSUI, - "react-semantic-toasts" -> Toasts, "chokidar" -> "3.4.2" ), libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % scalaJsReact, "com.github.japgolly.scalajs-react" %%% "extra" % scalaJsReact, "com.github.japgolly.scalajs-react" %%% "test" % scalaJsReact % Test, - "io.github.cquiroz.react" %%% "common" % "0.11.3", + "io.github.cquiroz.react" %%% "common" % "0.13.0", "org.scalameta" %%% "munit" % "0.7.27" % Test, - "com.lihaoyi" %%% "utest" % "0.7.10" % Test, "org.typelevel" %%% "cats-core" % "2.6.1" % Test ), Test / webpackConfigFile := Some(baseDirectory.value / "test.webpack.config.js"), diff --git a/demo/package.json b/demo/package.json index 225b4aeb..9a81509c 100644 --- a/demo/package.json +++ b/demo/package.json @@ -5,8 +5,8 @@ "license": "MIT", "dependencies": { "fomantic-ui-less": "^2.8.7", - "react": "^16.3.1", - "react-dom": "16.3.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", "react-semantic-toasts": "^0.6.5", "semantic-ui-react": "^2.0.3" }, diff --git a/demo/src/main/scala/react/semanticui/demo/HomeComponent.scala b/demo/src/main/scala/react/semanticui/demo/HomeComponent.scala index 5baaadae..4e77f093 100644 --- a/demo/src/main/scala/react/semanticui/demo/HomeComponent.scala +++ b/demo/src/main/scala/react/semanticui/demo/HomeComponent.scala @@ -2,8 +2,6 @@ package react.semanticui.demo import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.toasts._ -import react.semanticui.elements.button.Button object HomeComponent { private val component = @@ -33,11 +31,7 @@ object HomeComponent { "Semantic React UI" ) ) - ), - Button(onClick = toastCB(ToastOptions("Greetings"), onClose = Callback.log("here")))( - "Toast" - ), - SemanticToastContainer() + ) ) } .build diff --git a/demo/src/main/scala/react/semanticui/demo/elements/LabelsComponent.scala b/demo/src/main/scala/react/semanticui/demo/elements/LabelsComponent.scala index 609571c0..eb044476 100644 --- a/demo/src/main/scala/react/semanticui/demo/elements/LabelsComponent.scala +++ b/demo/src/main/scala/react/semanticui/demo/elements/LabelsComponent.scala @@ -2,6 +2,7 @@ package react.semanticui.demo import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.all._ import react.semanticui.elements.icon._ import react.semanticui.elements.label.Label import react.semanticui.elements.label.LabelDetail diff --git a/facade/src/main/scala/react/semanticui/addons/portal/Portal.scala b/facade/src/main/scala/react/semanticui/addons/portal/Portal.scala index aecf396c..06159ae9 100644 --- a/facade/src/main/scala/react/semanticui/addons/portal/Portal.scala +++ b/facade/src/main/scala/react/semanticui/addons/portal/Portal.scala @@ -3,9 +3,9 @@ package react.semanticui.addons.portal import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.JsNumber import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import japgolly.scalajs.react.vdom.TagMod diff --git a/facade/src/main/scala/react/semanticui/addons/portal/PortalInner.scala b/facade/src/main/scala/react/semanticui/addons/portal/PortalInner.scala index fd3836bd..3bd3b21f 100644 --- a/facade/src/main/scala/react/semanticui/addons/portal/PortalInner.scala +++ b/facade/src/main/scala/react/semanticui/addons/portal/PortalInner.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ // import japgolly.scalajs.react.Ref -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import japgolly.scalajs.react.vdom.TagMod diff --git a/facade/src/main/scala/react/semanticui/addons/radio/Radio.scala b/facade/src/main/scala/react/semanticui/addons/radio/Radio.scala index e624ea08..7050e1e9 100644 --- a/facade/src/main/scala/react/semanticui/addons/radio/Radio.scala +++ b/facade/src/main/scala/react/semanticui/addons/radio/Radio.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.JsNumber import react.common._ import react.semanticui._ import react.semanticui.modules.checkbox._ diff --git a/facade/src/main/scala/react/semanticui/addons/select/Select.scala b/facade/src/main/scala/react/semanticui/addons/select/Select.scala index e30f9abc..003d9465 100644 --- a/facade/src/main/scala/react/semanticui/addons/select/Select.scala +++ b/facade/src/main/scala/react/semanticui/addons/select/Select.scala @@ -1,7 +1,7 @@ package react.semanticui.addons.select import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.JsNumber import japgolly.scalajs.react.vdom.TagMod import japgolly.scalajs.react.vdom.VdomNode import scala.scalajs.js diff --git a/facade/src/main/scala/react/semanticui/addons/textarea/TextArea.scala b/facade/src/main/scala/react/semanticui/addons/textarea/TextArea.scala index fae84f41..0662f179 100644 --- a/facade/src/main/scala/react/semanticui/addons/textarea/TextArea.scala +++ b/facade/src/main/scala/react/semanticui/addons/textarea/TextArea.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.JsNumber import japgolly.scalajs.react.vdom.TagMod import react.common._ import react.semanticui._ diff --git a/facade/src/main/scala/react/semanticui/collections/form/Form.scala b/facade/src/main/scala/react/semanticui/collections/form/Form.scala index 4bbb3fe7..1f64f6dd 100644 --- a/facade/src/main/scala/react/semanticui/collections/form/Form.scala +++ b/facade/src/main/scala/react/semanticui/collections/form/Form.scala @@ -3,7 +3,7 @@ package react.semanticui.collections.form import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/form/FormButton.scala b/facade/src/main/scala/react/semanticui/collections/form/FormButton.scala index 708e237c..da875133 100644 --- a/facade/src/main/scala/react/semanticui/collections/form/FormButton.scala +++ b/facade/src/main/scala/react/semanticui/collections/form/FormButton.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import scala.scalajs.js.| import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.elements.label.Label diff --git a/facade/src/main/scala/react/semanticui/collections/form/FormCheckbox.scala b/facade/src/main/scala/react/semanticui/collections/form/FormCheckbox.scala index bff3622d..d38b60fd 100644 --- a/facade/src/main/scala/react/semanticui/collections/form/FormCheckbox.scala +++ b/facade/src/main/scala/react/semanticui/collections/form/FormCheckbox.scala @@ -4,8 +4,8 @@ import scala.scalajs.js import scala.scalajs.js.| import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.React +import japgolly.scalajs.react.facade.JsNumber import react.common._ import react.semanticui._ import react.semanticui.elements.label.Label diff --git a/facade/src/main/scala/react/semanticui/collections/form/FormDropdown.scala b/facade/src/main/scala/react/semanticui/collections/form/FormDropdown.scala index 92ec73d5..a95285a0 100644 --- a/facade/src/main/scala/react/semanticui/collections/form/FormDropdown.scala +++ b/facade/src/main/scala/react/semanticui/collections/form/FormDropdown.scala @@ -11,8 +11,8 @@ import react.semanticui.elements.label.Label import react.semanticui.elements.icon.Icon import react.semanticui.modules.dropdown._ import react.semanticui.{ raw => suiraw } -import japgolly.scalajs.react.raw.React -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.React +import japgolly.scalajs.react.facade.JsNumber import japgolly.scalajs.react.vdom.TagMod import japgolly.scalajs.react.vdom.VdomNode diff --git a/facade/src/main/scala/react/semanticui/collections/form/FormGroup.scala b/facade/src/main/scala/react/semanticui/collections/form/FormGroup.scala index 1a476ee2..a00ebc9a 100644 --- a/facade/src/main/scala/react/semanticui/collections/form/FormGroup.scala +++ b/facade/src/main/scala/react/semanticui/collections/form/FormGroup.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.| import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/form/FormInput.scala b/facade/src/main/scala/react/semanticui/collections/form/FormInput.scala index 48396e51..cd3561b0 100644 --- a/facade/src/main/scala/react/semanticui/collections/form/FormInput.scala +++ b/facade/src/main/scala/react/semanticui/collections/form/FormInput.scala @@ -4,8 +4,8 @@ import scala.scalajs.js import scala.scalajs.js.| import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.React +import japgolly.scalajs.react.facade.JsNumber import react.common._ import react.semanticui._ import react.semanticui.elements.label.Label diff --git a/facade/src/main/scala/react/semanticui/collections/form/FormSelect.scala b/facade/src/main/scala/react/semanticui/collections/form/FormSelect.scala index bd60f2fb..0a9c4586 100644 --- a/facade/src/main/scala/react/semanticui/collections/form/FormSelect.scala +++ b/facade/src/main/scala/react/semanticui/collections/form/FormSelect.scala @@ -10,7 +10,7 @@ import react.semanticui._ import react.semanticui.elements.label.Label import react.semanticui.elements.icon.Icon import react.semanticui.{ raw => suiraw } -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.JsNumber import japgolly.scalajs.react.vdom.TagMod import japgolly.scalajs.react.vdom.VdomNode import react.semanticui.addons.select.Select diff --git a/facade/src/main/scala/react/semanticui/collections/form/FormTextArea.scala b/facade/src/main/scala/react/semanticui/collections/form/FormTextArea.scala index a5868581..7222b491 100644 --- a/facade/src/main/scala/react/semanticui/collections/form/FormTextArea.scala +++ b/facade/src/main/scala/react/semanticui/collections/form/FormTextArea.scala @@ -10,7 +10,7 @@ import react.semanticui.elements.label.Label import react.semanticui.{ raw => suiraw } import react.semanticui.addons.textarea.TextArea import japgolly.scalajs.react.vdom.TagMod -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.JsNumber import japgolly.scalajs.react.vdom.VdomNode final case class FormTextArea( diff --git a/facade/src/main/scala/react/semanticui/collections/grid/Grid.scala b/facade/src/main/scala/react/semanticui/collections/grid/Grid.scala index 4f12e592..c5e395e6 100644 --- a/facade/src/main/scala/react/semanticui/collections/grid/Grid.scala +++ b/facade/src/main/scala/react/semanticui/collections/grid/Grid.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/grid/GridColumn.scala b/facade/src/main/scala/react/semanticui/collections/grid/GridColumn.scala index 522a0891..a128a8cf 100644 --- a/facade/src/main/scala/react/semanticui/collections/grid/GridColumn.scala +++ b/facade/src/main/scala/react/semanticui/collections/grid/GridColumn.scala @@ -3,7 +3,7 @@ package react.semanticui.collections.grid import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/grid/GridRow.scala b/facade/src/main/scala/react/semanticui/collections/grid/GridRow.scala index a31775c1..d1739f87 100644 --- a/facade/src/main/scala/react/semanticui/collections/grid/GridRow.scala +++ b/facade/src/main/scala/react/semanticui/collections/grid/GridRow.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/menu/Menu.scala b/facade/src/main/scala/react/semanticui/collections/menu/Menu.scala index a4aed3de..305a2010 100644 --- a/facade/src/main/scala/react/semanticui/collections/menu/Menu.scala +++ b/facade/src/main/scala/react/semanticui/collections/menu/Menu.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import scala.scalajs.js.| import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/menu/MenuHeader.scala b/facade/src/main/scala/react/semanticui/collections/menu/MenuHeader.scala index 104e4713..52b0c041 100644 --- a/facade/src/main/scala/react/semanticui/collections/menu/MenuHeader.scala +++ b/facade/src/main/scala/react/semanticui/collections/menu/MenuHeader.scala @@ -3,7 +3,7 @@ package react.semanticui.collections.menu import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/menu/MenuItem.scala b/facade/src/main/scala/react/semanticui/collections/menu/MenuItem.scala index c5b8b821..78b515c0 100644 --- a/facade/src/main/scala/react/semanticui/collections/menu/MenuItem.scala +++ b/facade/src/main/scala/react/semanticui/collections/menu/MenuItem.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import scala.scalajs.js.| import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/menu/MenuMenu.scala b/facade/src/main/scala/react/semanticui/collections/menu/MenuMenu.scala index 4bce9393..e1ddf0e7 100644 --- a/facade/src/main/scala/react/semanticui/collections/menu/MenuMenu.scala +++ b/facade/src/main/scala/react/semanticui/collections/menu/MenuMenu.scala @@ -3,7 +3,7 @@ package react.semanticui.collections.menu import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/message/Message.scala b/facade/src/main/scala/react/semanticui/collections/message/Message.scala index 70ada21c..723b696f 100644 --- a/facade/src/main/scala/react/semanticui/collections/message/Message.scala +++ b/facade/src/main/scala/react/semanticui/collections/message/Message.scala @@ -5,7 +5,7 @@ import js.| import js.annotation._ import js.JSConverters._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/message/MessageContent.scala b/facade/src/main/scala/react/semanticui/collections/message/MessageContent.scala index 68170785..2b25e145 100644 --- a/facade/src/main/scala/react/semanticui/collections/message/MessageContent.scala +++ b/facade/src/main/scala/react/semanticui/collections/message/MessageContent.scala @@ -3,7 +3,7 @@ package react.semanticui.collections.message import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/message/MessageHeader.scala b/facade/src/main/scala/react/semanticui/collections/message/MessageHeader.scala index c86617de..6b3496f9 100644 --- a/facade/src/main/scala/react/semanticui/collections/message/MessageHeader.scala +++ b/facade/src/main/scala/react/semanticui/collections/message/MessageHeader.scala @@ -3,7 +3,7 @@ package react.semanticui.collections.message import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/message/MessageItem.scala b/facade/src/main/scala/react/semanticui/collections/message/MessageItem.scala index 14f0d06c..69da86fd 100644 --- a/facade/src/main/scala/react/semanticui/collections/message/MessageItem.scala +++ b/facade/src/main/scala/react/semanticui/collections/message/MessageItem.scala @@ -3,7 +3,7 @@ package react.semanticui.collections.message import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/message/MessageList.scala b/facade/src/main/scala/react/semanticui/collections/message/MessageList.scala index 7c196d5f..35fcc6f1 100644 --- a/facade/src/main/scala/react/semanticui/collections/message/MessageList.scala +++ b/facade/src/main/scala/react/semanticui/collections/message/MessageList.scala @@ -3,7 +3,7 @@ package react.semanticui.collections.message import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/table/Table.scala b/facade/src/main/scala/react/semanticui/collections/table/Table.scala index 2984ee71..e982c0bd 100644 --- a/facade/src/main/scala/react/semanticui/collections/table/Table.scala +++ b/facade/src/main/scala/react/semanticui/collections/table/Table.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.html_<^._ import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/collections/table/TableBody.scala b/facade/src/main/scala/react/semanticui/collections/table/TableBody.scala index 2650fba1..1a02a89c 100644 --- a/facade/src/main/scala/react/semanticui/collections/table/TableBody.scala +++ b/facade/src/main/scala/react/semanticui/collections/table/TableBody.scala @@ -3,7 +3,7 @@ package react.semanticui.collections.table import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.html_<^._ import react.common._ import react.semanticui._ diff --git a/facade/src/main/scala/react/semanticui/collections/table/TableCell.scala b/facade/src/main/scala/react/semanticui/collections/table/TableCell.scala index 6393e569..ea7d81e9 100644 --- a/facade/src/main/scala/react/semanticui/collections/table/TableCell.scala +++ b/facade/src/main/scala/react/semanticui/collections/table/TableCell.scala @@ -3,7 +3,7 @@ package react.semanticui.collections.table import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.html_<^._ import react.common._ import react.semanticui.elements.icon.Icon diff --git a/facade/src/main/scala/react/semanticui/collections/table/TableFooter.scala b/facade/src/main/scala/react/semanticui/collections/table/TableFooter.scala index f3bf45b9..01a3c015 100644 --- a/facade/src/main/scala/react/semanticui/collections/table/TableFooter.scala +++ b/facade/src/main/scala/react/semanticui/collections/table/TableFooter.scala @@ -3,7 +3,7 @@ package react.semanticui.collections.table import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.html_<^._ import japgolly.scalajs.react.vdom.VdomNode import react.common._ diff --git a/facade/src/main/scala/react/semanticui/collections/table/TableHeader.scala b/facade/src/main/scala/react/semanticui/collections/table/TableHeader.scala index 8db0d700..d66e1315 100644 --- a/facade/src/main/scala/react/semanticui/collections/table/TableHeader.scala +++ b/facade/src/main/scala/react/semanticui/collections/table/TableHeader.scala @@ -3,7 +3,7 @@ package react.semanticui.collections.table import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.html_<^._ import japgolly.scalajs.react.vdom.VdomNode import react.common._ diff --git a/facade/src/main/scala/react/semanticui/collections/table/TableHeaderCell.scala b/facade/src/main/scala/react/semanticui/collections/table/TableHeaderCell.scala index 647725f2..cf404df4 100644 --- a/facade/src/main/scala/react/semanticui/collections/table/TableHeaderCell.scala +++ b/facade/src/main/scala/react/semanticui/collections/table/TableHeaderCell.scala @@ -3,7 +3,7 @@ package react.semanticui.collections.table import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.html_<^._ import react.common._ import react.semanticui.elements.icon.Icon diff --git a/facade/src/main/scala/react/semanticui/collections/table/TableRow.scala b/facade/src/main/scala/react/semanticui/collections/table/TableRow.scala index f64f5c4c..17f46b45 100644 --- a/facade/src/main/scala/react/semanticui/collections/table/TableRow.scala +++ b/facade/src/main/scala/react/semanticui/collections/table/TableRow.scala @@ -5,7 +5,7 @@ import js.annotation._ import js.| import js.JSConverters._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.html_<^._ import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/button/Button.scala b/facade/src/main/scala/react/semanticui/elements/button/Button.scala index 42ba0836..f0717884 100644 --- a/facade/src/main/scala/react/semanticui/elements/button/Button.scala +++ b/facade/src/main/scala/react/semanticui/elements/button/Button.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui.{ raw => suiraw } import react.semanticui._ diff --git a/facade/src/main/scala/react/semanticui/elements/button/ButtonContent.scala b/facade/src/main/scala/react/semanticui/elements/button/ButtonContent.scala index b37f68e6..2d4766eb 100644 --- a/facade/src/main/scala/react/semanticui/elements/button/ButtonContent.scala +++ b/facade/src/main/scala/react/semanticui/elements/button/ButtonContent.scala @@ -3,7 +3,7 @@ package react.semanticui.elements.button import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/button/ButtonGroup.scala b/facade/src/main/scala/react/semanticui/elements/button/ButtonGroup.scala index d5750ded..951089a7 100644 --- a/facade/src/main/scala/react/semanticui/elements/button/ButtonGroup.scala +++ b/facade/src/main/scala/react/semanticui/elements/button/ButtonGroup.scala @@ -5,7 +5,7 @@ import js.annotation._ import js.| import js.JSConverters._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/button/ButtonOr.scala b/facade/src/main/scala/react/semanticui/elements/button/ButtonOr.scala index efc9fce9..7859f0e5 100644 --- a/facade/src/main/scala/react/semanticui/elements/button/ButtonOr.scala +++ b/facade/src/main/scala/react/semanticui/elements/button/ButtonOr.scala @@ -5,7 +5,7 @@ import js.annotation._ import js.| import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.TagMod -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.JsNumber import react.semanticui._ import react.common._ diff --git a/facade/src/main/scala/react/semanticui/elements/container/Container.scala b/facade/src/main/scala/react/semanticui/elements/container/Container.scala index 51e6d742..5b3d3126 100644 --- a/facade/src/main/scala/react/semanticui/elements/container/Container.scala +++ b/facade/src/main/scala/react/semanticui/elements/container/Container.scala @@ -3,7 +3,7 @@ package react.semanticui.elements.container import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui.{ raw => suiraw } import react.semanticui._ diff --git a/facade/src/main/scala/react/semanticui/elements/divider/Divider.scala b/facade/src/main/scala/react/semanticui/elements/divider/Divider.scala index d7e4773c..27536699 100644 --- a/facade/src/main/scala/react/semanticui/elements/divider/Divider.scala +++ b/facade/src/main/scala/react/semanticui/elements/divider/Divider.scala @@ -3,7 +3,7 @@ package react.semanticui.elements.divider import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui.{ raw => suiraw } import react.semanticui._ diff --git a/facade/src/main/scala/react/semanticui/elements/header/Header.scala b/facade/src/main/scala/react/semanticui/elements/header/Header.scala index 208adaa4..3048f05b 100644 --- a/facade/src/main/scala/react/semanticui/elements/header/Header.scala +++ b/facade/src/main/scala/react/semanticui/elements/header/Header.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui.{ raw => suiraw } import react.semanticui._ diff --git a/facade/src/main/scala/react/semanticui/elements/header/HeaderContent.scala b/facade/src/main/scala/react/semanticui/elements/header/HeaderContent.scala index c170f8d3..f3239dcb 100644 --- a/facade/src/main/scala/react/semanticui/elements/header/HeaderContent.scala +++ b/facade/src/main/scala/react/semanticui/elements/header/HeaderContent.scala @@ -3,7 +3,7 @@ package react.semanticui.elements.header import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/header/HeaderSubheader.scala b/facade/src/main/scala/react/semanticui/elements/header/HeaderSubheader.scala index b120bfd6..357d5607 100644 --- a/facade/src/main/scala/react/semanticui/elements/header/HeaderSubheader.scala +++ b/facade/src/main/scala/react/semanticui/elements/header/HeaderSubheader.scala @@ -3,7 +3,7 @@ package react.semanticui.elements.header import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/icon/IconGroup.scala b/facade/src/main/scala/react/semanticui/elements/icon/IconGroup.scala index f7f6a78a..5f5c89e5 100644 --- a/facade/src/main/scala/react/semanticui/elements/icon/IconGroup.scala +++ b/facade/src/main/scala/react/semanticui/elements/icon/IconGroup.scala @@ -1,7 +1,7 @@ package react.semanticui.elements.icon import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import scala.scalajs.js diff --git a/facade/src/main/scala/react/semanticui/elements/image/Image.scala b/facade/src/main/scala/react/semanticui/elements/image/Image.scala index 9d5a1322..74368193 100644 --- a/facade/src/main/scala/react/semanticui/elements/image/Image.scala +++ b/facade/src/main/scala/react/semanticui/elements/image/Image.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui.{ raw => suiraw } import react.semanticui._ diff --git a/facade/src/main/scala/react/semanticui/elements/input/Input.scala b/facade/src/main/scala/react/semanticui/elements/input/Input.scala index 318db7dc..38b1680e 100644 --- a/facade/src/main/scala/react/semanticui/elements/input/Input.scala +++ b/facade/src/main/scala/react/semanticui/elements/input/Input.scala @@ -4,8 +4,8 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.React +import japgolly.scalajs.react.facade.JsNumber import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/label/Label.scala b/facade/src/main/scala/react/semanticui/elements/label/Label.scala index 48c6f6a0..bb676d1e 100644 --- a/facade/src/main/scala/react/semanticui/elements/label/Label.scala +++ b/facade/src/main/scala/react/semanticui/elements/label/Label.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/label/LabelDetail.scala b/facade/src/main/scala/react/semanticui/elements/label/LabelDetail.scala index d4272857..20f3e0f5 100644 --- a/facade/src/main/scala/react/semanticui/elements/label/LabelDetail.scala +++ b/facade/src/main/scala/react/semanticui/elements/label/LabelDetail.scala @@ -3,7 +3,7 @@ package react.semanticui.elements.label import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.semanticui._ import react.semanticui.raw._ import react.common._ diff --git a/facade/src/main/scala/react/semanticui/elements/label/LabelGroup.scala b/facade/src/main/scala/react/semanticui/elements/label/LabelGroup.scala index 4947c1ed..fba23fc2 100644 --- a/facade/src/main/scala/react/semanticui/elements/label/LabelGroup.scala +++ b/facade/src/main/scala/react/semanticui/elements/label/LabelGroup.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import js.JSConverters._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/list/List.scala b/facade/src/main/scala/react/semanticui/elements/list/List.scala index 1bee2ef3..5a6ed107 100644 --- a/facade/src/main/scala/react/semanticui/elements/list/List.scala +++ b/facade/src/main/scala/react/semanticui/elements/list/List.scala @@ -5,7 +5,7 @@ import js.annotation._ import js.| import js.JSConverters._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import japgolly.scalajs.react.vdom.html_<^._ import react.common._ diff --git a/facade/src/main/scala/react/semanticui/elements/list/ListContent.scala b/facade/src/main/scala/react/semanticui/elements/list/ListContent.scala index 4afe5a3f..944222c9 100644 --- a/facade/src/main/scala/react/semanticui/elements/list/ListContent.scala +++ b/facade/src/main/scala/react/semanticui/elements/list/ListContent.scala @@ -5,7 +5,7 @@ import js.JSConverters._ import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/list/ListHeader.scala b/facade/src/main/scala/react/semanticui/elements/list/ListHeader.scala index f1e1e3f5..28499400 100644 --- a/facade/src/main/scala/react/semanticui/elements/list/ListHeader.scala +++ b/facade/src/main/scala/react/semanticui/elements/list/ListHeader.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/list/ListItem.scala b/facade/src/main/scala/react/semanticui/elements/list/ListItem.scala index 95eb9fe9..c8aa04cc 100644 --- a/facade/src/main/scala/react/semanticui/elements/list/ListItem.scala +++ b/facade/src/main/scala/react/semanticui/elements/list/ListItem.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.elements.image._ diff --git a/facade/src/main/scala/react/semanticui/elements/list/ListList.scala b/facade/src/main/scala/react/semanticui/elements/list/ListList.scala index 64825832..6a930994 100644 --- a/facade/src/main/scala/react/semanticui/elements/list/ListList.scala +++ b/facade/src/main/scala/react/semanticui/elements/list/ListList.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/loader/Loader.scala b/facade/src/main/scala/react/semanticui/elements/loader/Loader.scala index 505da530..4d25ed45 100644 --- a/facade/src/main/scala/react/semanticui/elements/loader/Loader.scala +++ b/facade/src/main/scala/react/semanticui/elements/loader/Loader.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/placeholder/Placeholder.scala b/facade/src/main/scala/react/semanticui/elements/placeholder/Placeholder.scala index a7de95cc..e9103f9f 100644 --- a/facade/src/main/scala/react/semanticui/elements/placeholder/Placeholder.scala +++ b/facade/src/main/scala/react/semanticui/elements/placeholder/Placeholder.scala @@ -3,7 +3,7 @@ package react.semanticui.elements.placeholder import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderHeader.scala b/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderHeader.scala index a8283c30..469c45b1 100644 --- a/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderHeader.scala +++ b/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderHeader.scala @@ -3,7 +3,7 @@ package react.semanticui.elements.placeholder import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderImage.scala b/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderImage.scala index e8a2090c..715bd27a 100644 --- a/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderImage.scala +++ b/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderImage.scala @@ -3,7 +3,7 @@ package react.semanticui.elements.placeholder import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderLine.scala b/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderLine.scala index fbcffa9e..bc6b202a 100644 --- a/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderLine.scala +++ b/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderLine.scala @@ -3,7 +3,7 @@ package react.semanticui.elements.placeholder import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import japgolly.scalajs.react.vdom.TagMod diff --git a/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderParagraph.scala b/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderParagraph.scala index a3b490dc..02122ace 100644 --- a/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderParagraph.scala +++ b/facade/src/main/scala/react/semanticui/elements/placeholder/PlaceholderParagraph.scala @@ -3,7 +3,7 @@ package react.semanticui.elements.placeholder import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/rail/Rail.scala b/facade/src/main/scala/react/semanticui/elements/rail/Rail.scala index d52cd60e..28dd1356 100644 --- a/facade/src/main/scala/react/semanticui/elements/rail/Rail.scala +++ b/facade/src/main/scala/react/semanticui/elements/rail/Rail.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import scala.scalajs.js.| import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/segment/Segment.scala b/facade/src/main/scala/react/semanticui/elements/segment/Segment.scala index 4799c5ea..e37f6383 100644 --- a/facade/src/main/scala/react/semanticui/elements/segment/Segment.scala +++ b/facade/src/main/scala/react/semanticui/elements/segment/Segment.scala @@ -5,7 +5,7 @@ import scala.scalajs.js.| import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.JsFnComponent -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/segment/SegmentGroup.scala b/facade/src/main/scala/react/semanticui/elements/segment/SegmentGroup.scala index 231361d3..7e739fdd 100644 --- a/facade/src/main/scala/react/semanticui/elements/segment/SegmentGroup.scala +++ b/facade/src/main/scala/react/semanticui/elements/segment/SegmentGroup.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.JsFnComponent -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/elements/segment/SegmentInline.scala b/facade/src/main/scala/react/semanticui/elements/segment/SegmentInline.scala index e0d574b3..a2ca3d56 100644 --- a/facade/src/main/scala/react/semanticui/elements/segment/SegmentInline.scala +++ b/facade/src/main/scala/react/semanticui/elements/segment/SegmentInline.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.JsFnComponent -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.raw._ diff --git a/facade/src/main/scala/react/semanticui/modules/accordion/Accordion.scala b/facade/src/main/scala/react/semanticui/modules/accordion/Accordion.scala index 1404f02e..4e6a1984 100644 --- a/facade/src/main/scala/react/semanticui/modules/accordion/Accordion.scala +++ b/facade/src/main/scala/react/semanticui/modules/accordion/Accordion.scala @@ -5,8 +5,8 @@ import js.annotation._ import js.| import js.JSConverters._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.JsNumber -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.JsNumber +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import japgolly.scalajs.react.vdom.TagMod diff --git a/facade/src/main/scala/react/semanticui/modules/accordion/AccordionContent.scala b/facade/src/main/scala/react/semanticui/modules/accordion/AccordionContent.scala index c5ba61db..77d77d48 100644 --- a/facade/src/main/scala/react/semanticui/modules/accordion/AccordionContent.scala +++ b/facade/src/main/scala/react/semanticui/modules/accordion/AccordionContent.scala @@ -3,7 +3,7 @@ package react.semanticui.modules.accordion import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.raw._ diff --git a/facade/src/main/scala/react/semanticui/modules/accordion/AccordionPanel.scala b/facade/src/main/scala/react/semanticui/modules/accordion/AccordionPanel.scala index 566242b2..b9f6df03 100644 --- a/facade/src/main/scala/react/semanticui/modules/accordion/AccordionPanel.scala +++ b/facade/src/main/scala/react/semanticui/modules/accordion/AccordionPanel.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.JsNumber import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/modules/accordion/AccordionTitle.scala b/facade/src/main/scala/react/semanticui/modules/accordion/AccordionTitle.scala index 27baff77..8bdd2a4a 100644 --- a/facade/src/main/scala/react/semanticui/modules/accordion/AccordionTitle.scala +++ b/facade/src/main/scala/react/semanticui/modules/accordion/AccordionTitle.scala @@ -4,8 +4,8 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.JsNumber -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.JsNumber +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.raw._ diff --git a/facade/src/main/scala/react/semanticui/modules/checkbox/Checkbox.scala b/facade/src/main/scala/react/semanticui/modules/checkbox/Checkbox.scala index 9852c80a..380932f6 100644 --- a/facade/src/main/scala/react/semanticui/modules/checkbox/Checkbox.scala +++ b/facade/src/main/scala/react/semanticui/modules/checkbox/Checkbox.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.JsNumber import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/modules/dimmer/DimmerDimmable.scala b/facade/src/main/scala/react/semanticui/modules/dimmer/DimmerDimmable.scala index 4e19322a..af73c0fd 100644 --- a/facade/src/main/scala/react/semanticui/modules/dimmer/DimmerDimmable.scala +++ b/facade/src/main/scala/react/semanticui/modules/dimmer/DimmerDimmable.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/modules/dimmer/DimmerInner.scala b/facade/src/main/scala/react/semanticui/modules/dimmer/DimmerInner.scala index 44047a9b..d48a618c 100644 --- a/facade/src/main/scala/react/semanticui/modules/dimmer/DimmerInner.scala +++ b/facade/src/main/scala/react/semanticui/modules/dimmer/DimmerInner.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/modules/dropdown/Dropdown.scala b/facade/src/main/scala/react/semanticui/modules/dropdown/Dropdown.scala index b0b4f8e3..df706610 100644 --- a/facade/src/main/scala/react/semanticui/modules/dropdown/Dropdown.scala +++ b/facade/src/main/scala/react/semanticui/modules/dropdown/Dropdown.scala @@ -5,8 +5,8 @@ import js.annotation._ import js.| import js.JSConverters._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.React +import japgolly.scalajs.react.facade.JsNumber import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownHeader.scala b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownHeader.scala index 14eb7bad..6d1ca7b8 100644 --- a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownHeader.scala +++ b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownHeader.scala @@ -3,7 +3,7 @@ package react.semanticui.modules.dropdown import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownItem.scala b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownItem.scala index f0dee0d5..baa9c426 100644 --- a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownItem.scala +++ b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownItem.scala @@ -4,8 +4,8 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.React +import japgolly.scalajs.react.facade.JsNumber import japgolly.scalajs.react.vdom.html_<^._ import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownMenu.scala b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownMenu.scala index 5663be5d..366631fe 100644 --- a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownMenu.scala +++ b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownMenu.scala @@ -3,7 +3,7 @@ package react.semanticui.modules.dropdown import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.raw._ diff --git a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownSearchInput.scala b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownSearchInput.scala index 430cb00e..034bec8c 100644 --- a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownSearchInput.scala +++ b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownSearchInput.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.JsNumber import react.semanticui._ import react.common._ import japgolly.scalajs.react.vdom.TagMod diff --git a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownText.scala b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownText.scala index fbc86fa5..dbbab748 100644 --- a/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownText.scala +++ b/facade/src/main/scala/react/semanticui/modules/dropdown/DropdownText.scala @@ -3,7 +3,7 @@ package react.semanticui.modules.dropdown import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.html_<^._ import japgolly.scalajs.react.JsFnComponent import react.semanticui._ diff --git a/facade/src/main/scala/react/semanticui/modules/modal/Modal.scala b/facade/src/main/scala/react/semanticui/modules/modal/Modal.scala index 608b2f30..1236c311 100644 --- a/facade/src/main/scala/react/semanticui/modules/modal/Modal.scala +++ b/facade/src/main/scala/react/semanticui/modules/modal/Modal.scala @@ -5,7 +5,7 @@ import js.annotation._ import js.| import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.TagMod import react.common._ import react.semanticui._ diff --git a/facade/src/main/scala/react/semanticui/modules/modal/ModalActions.scala b/facade/src/main/scala/react/semanticui/modules/modal/ModalActions.scala index 2a976b4e..a24ac05e 100644 --- a/facade/src/main/scala/react/semanticui/modules/modal/ModalActions.scala +++ b/facade/src/main/scala/react/semanticui/modules/modal/ModalActions.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.elements.button.Button diff --git a/facade/src/main/scala/react/semanticui/modules/modal/ModalContent.scala b/facade/src/main/scala/react/semanticui/modules/modal/ModalContent.scala index 10199b64..a83f82f2 100644 --- a/facade/src/main/scala/react/semanticui/modules/modal/ModalContent.scala +++ b/facade/src/main/scala/react/semanticui/modules/modal/ModalContent.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/modules/modal/ModalDescription.scala b/facade/src/main/scala/react/semanticui/modules/modal/ModalDescription.scala index 6451346f..1217b303 100644 --- a/facade/src/main/scala/react/semanticui/modules/modal/ModalDescription.scala +++ b/facade/src/main/scala/react/semanticui/modules/modal/ModalDescription.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/modules/modal/ModalDimmer.scala b/facade/src/main/scala/react/semanticui/modules/modal/ModalDimmer.scala index 82e032fc..71c9aabf 100644 --- a/facade/src/main/scala/react/semanticui/modules/modal/ModalDimmer.scala +++ b/facade/src/main/scala/react/semanticui/modules/modal/ModalDimmer.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/modules/modal/ModalHeader.scala b/facade/src/main/scala/react/semanticui/modules/modal/ModalHeader.scala index 00e43d05..d83761b5 100644 --- a/facade/src/main/scala/react/semanticui/modules/modal/ModalHeader.scala +++ b/facade/src/main/scala/react/semanticui/modules/modal/ModalHeader.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/modules/popup/Popup.scala b/facade/src/main/scala/react/semanticui/modules/popup/Popup.scala index 46ed80d9..e64de2bc 100644 --- a/facade/src/main/scala/react/semanticui/modules/popup/Popup.scala +++ b/facade/src/main/scala/react/semanticui/modules/popup/Popup.scala @@ -5,8 +5,8 @@ import js.annotation._ import js.| import js.JSConverters._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.React +import japgolly.scalajs.react.facade.JsNumber import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui._ diff --git a/facade/src/main/scala/react/semanticui/modules/popup/PopupContent.scala b/facade/src/main/scala/react/semanticui/modules/popup/PopupContent.scala index ee21a620..3121c3b5 100644 --- a/facade/src/main/scala/react/semanticui/modules/popup/PopupContent.scala +++ b/facade/src/main/scala/react/semanticui/modules/popup/PopupContent.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/modules/popup/PopupHeader.scala b/facade/src/main/scala/react/semanticui/modules/popup/PopupHeader.scala index 6da182d4..1c812c05 100644 --- a/facade/src/main/scala/react/semanticui/modules/popup/PopupHeader.scala +++ b/facade/src/main/scala/react/semanticui/modules/popup/PopupHeader.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/modules/progress/Progress.scala b/facade/src/main/scala/react/semanticui/modules/progress/Progress.scala index e33288fe..3324cc39 100644 --- a/facade/src/main/scala/react/semanticui/modules/progress/Progress.scala +++ b/facade/src/main/scala/react/semanticui/modules/progress/Progress.scala @@ -4,8 +4,8 @@ import scala.scalajs.js import js.annotation._ import js.| import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React -import japgolly.scalajs.react.raw.JsNumber +import japgolly.scalajs.react.facade.React +import japgolly.scalajs.react.facade.JsNumber import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/modules/sidebar/Sidebar.scala b/facade/src/main/scala/react/semanticui/modules/sidebar/Sidebar.scala index 2bf0b716..f752e7e9 100644 --- a/facade/src/main/scala/react/semanticui/modules/sidebar/Sidebar.scala +++ b/facade/src/main/scala/react/semanticui/modules/sidebar/Sidebar.scala @@ -4,8 +4,8 @@ import scala.scalajs.js import scala.scalajs.js.| import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React -import japgolly.scalajs.react.raw.React.Ref +import japgolly.scalajs.react.facade.React +import japgolly.scalajs.react.facade.React.Ref import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.raw._ diff --git a/facade/src/main/scala/react/semanticui/modules/sidebar/SidebarPushable.scala b/facade/src/main/scala/react/semanticui/modules/sidebar/SidebarPushable.scala index d1124bb9..8930701f 100644 --- a/facade/src/main/scala/react/semanticui/modules/sidebar/SidebarPushable.scala +++ b/facade/src/main/scala/react/semanticui/modules/sidebar/SidebarPushable.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.JsFnComponent -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.raw._ diff --git a/facade/src/main/scala/react/semanticui/modules/sidebar/SidebarPusher.scala b/facade/src/main/scala/react/semanticui/modules/sidebar/SidebarPusher.scala index 5d7c4d00..77bd9d14 100644 --- a/facade/src/main/scala/react/semanticui/modules/sidebar/SidebarPusher.scala +++ b/facade/src/main/scala/react/semanticui/modules/sidebar/SidebarPusher.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.JsFnComponent -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.raw._ diff --git a/facade/src/main/scala/react/semanticui/modules/tab/Tab.scala b/facade/src/main/scala/react/semanticui/modules/tab/Tab.scala index 0cbfcea4..2acd1fa9 100644 --- a/facade/src/main/scala/react/semanticui/modules/tab/Tab.scala +++ b/facade/src/main/scala/react/semanticui/modules/tab/Tab.scala @@ -5,8 +5,8 @@ import js.annotation._ import js.| import js.JSConverters._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.JsNumber -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.JsNumber +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom.VdomNode import react.common._ import react.semanticui.collections.menu.Menu diff --git a/facade/src/main/scala/react/semanticui/modules/tab/TabPane.scala b/facade/src/main/scala/react/semanticui/modules/tab/TabPane.scala index bb7eadc8..d611211d 100644 --- a/facade/src/main/scala/react/semanticui/modules/tab/TabPane.scala +++ b/facade/src/main/scala/react/semanticui/modules/tab/TabPane.scala @@ -3,7 +3,7 @@ package react.semanticui.modules.tab import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.JsFnComponent import japgolly.scalajs.react.vdom.VdomNode import react.common._ diff --git a/facade/src/main/scala/react/semanticui/package.scala b/facade/src/main/scala/react/semanticui/package.scala index 169172c2..7bd58bbc 100644 --- a/facade/src/main/scala/react/semanticui/package.scala +++ b/facade/src/main/scala/react/semanticui/package.scala @@ -5,7 +5,7 @@ import js.annotation.JSImport import js.| import js.JSConverters._ import japgolly.scalajs.react.component.Generic -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import japgolly.scalajs.react.vdom._ import react.common._ diff --git a/facade/src/main/scala/react/semanticui/toasts/SemanticToastContainer.scala b/facade/src/main/scala/react/semanticui/toasts/SemanticToastContainer.scala deleted file mode 100644 index 108abb98..00000000 --- a/facade/src/main/scala/react/semanticui/toasts/SemanticToastContainer.scala +++ /dev/null @@ -1,71 +0,0 @@ -package react.semanticui.toasts - -import scala.scalajs.js -import js.annotation._ -import japgolly.scalajs.react._ -import react.common._ -import japgolly.scalajs.react.vdom.TagMod - -final case class SemanticToastContainer( - position: js.UndefOr[ContainerPosition] = js.undefined, - animation: js.UndefOr[SemanticAnimation] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined, - override val modifiers: Seq[TagMod] = Seq.empty -) extends GenericComponentPA[ - SemanticToastContainer.SemanticToastContainerProps, - SemanticToastContainer - ] { - override protected def cprops = SemanticToastContainer.props(this) - override protected val component = SemanticToastContainer.component - override def addModifiers(modifiers: Seq[TagMod]) = copy(modifiers = this.modifiers ++ modifiers) -} - -object SemanticToastContainer { - @js.native - @JSImport("react-semantic-toasts", "SemanticToastContainer") - object RawComponent extends js.Function1[js.Any, js.Any] { - def apply(i: js.Any): js.Any = js.native - } - - @js.native - trait SemanticToastContainerProps extends js.Object { - @JSBracketAccess - def apply(key: String): js.Any = js.native - - @JSBracketAccess - def update(key: String, v: js.Any): Unit = js.native - - var position: js.UndefOr[String] = js.native - - var animation: js.UndefOr[String] = js.native - - var className: js.UndefOr[String] = js.native - - } - - def props(q: SemanticToastContainer): SemanticToastContainerProps = - rawprops( - q.position, - q.animation, - q.className, - q.clazz - ) - - def rawprops( - position: js.UndefOr[ContainerPosition] = js.undefined, - animation: js.UndefOr[SemanticAnimation] = js.undefined, - className: js.UndefOr[String] = js.undefined, - clazz: js.UndefOr[Css] = js.undefined - ): SemanticToastContainerProps = { - val p = (new js.Object).asInstanceOf[SemanticToastContainerProps] - position.toJs.foreach(v => p.position = v) - animation.toJs.foreach(v => p.animation = v) - (className, clazz).toJs.foreach(v => p.className = v) - p - } - - private val component = - JsComponent[SemanticToastContainerProps, Children.None, Null](RawComponent) - -} diff --git a/facade/src/main/scala/react/semanticui/toasts/package.scala b/facade/src/main/scala/react/semanticui/toasts/package.scala deleted file mode 100644 index afa92f8c..00000000 --- a/facade/src/main/scala/react/semanticui/toasts/package.scala +++ /dev/null @@ -1,201 +0,0 @@ -package react.semanticui - -import japgolly.scalajs.react.raw.JsNumber -import japgolly.scalajs.react.Callback -import react.common._ -import react.semanticui.{ raw => suiraw } -import react.semanticui.elements.icon.Icon -import scala.scalajs.js -import scala.scalajs.js.annotation._ -import scala.concurrent.duration._ - -package toasts { - sealed trait ContainerPosition extends Product with Serializable - object ContainerPosition { - implicit val enum: EnumValue[ContainerPosition] = EnumValue.instance { - case TopRight => "top-right" - case TopCenter => "top-center" - case TopLeft => "top-left" - case BottomRight => "bottom-right" - case BottomCenter => "bottom-center" - case BottomLeft => "bottom-left" - } - - case object TopRight extends ContainerPosition - case object TopCenter extends ContainerPosition - case object TopLeft extends ContainerPosition - case object BottomRight extends ContainerPosition - case object BottomCenter extends ContainerPosition - case object BottomLeft extends ContainerPosition - } - - sealed trait ToastType extends Product with Serializable - object ToastType { - implicit val enum: EnumValue[ToastType] = EnumValue.instance { - case Info => "info" - case Success => "success" - case Warning => "warning" - case Error => "error" - } - - case object Info extends ToastType - case object Success extends ToastType - case object Warning extends ToastType - case object Error extends ToastType - } - - sealed trait SemanticAnimation extends Product with Serializable - object SemanticAnimation { - implicit val enum: EnumValue[SemanticAnimation] = EnumValue.instance { - case Scale => "scale" - case Zoom => "zoom" - case Fade => "fade" - case FadeUp => "fade up" - case FadeDown => "fade down" - case FadeLeft => "fade left" - case FadeRight => "fade right" - case HorizontalFlip => "horizontal flip" - case VerticalFlip => "vertical flip" - case Drop => "drop" - case FlyLeft => "fly left" - case FlyRight => "fly right" - case FlyDown => "fly down" - case FlyUp => "fly up" - case SwingLeft => "swing left" - case SwingRight => "swing right" - case SwingUp => "swing up" - case SwingDown => "swing down" - case Browse => "browse" - case BrowseRight => "browse right" - case SlideDown => "slide down" - case SlideUp => "slide up" - case SlideLeft => "slide left" - case SlideRight => "slide right" - case Jiggle => "jiggle" - case Flash => "flash" - case Shake => "shake" - case Pulse => "pulse" - case Tada => "tada" - case Bounce => "bounce" - case Glow => "glow" - } - - case object Scale extends SemanticAnimation - case object Zoom extends SemanticAnimation - case object Fade extends SemanticAnimation - case object FadeUp extends SemanticAnimation - case object FadeDown extends SemanticAnimation - case object FadeLeft extends SemanticAnimation - case object FadeRight extends SemanticAnimation - case object HorizontalFlip extends SemanticAnimation - case object VerticalFlip extends SemanticAnimation - case object Drop extends SemanticAnimation - case object FlyLeft extends SemanticAnimation - case object FlyRight extends SemanticAnimation - case object FlyDown extends SemanticAnimation - case object FlyUp extends SemanticAnimation - case object SwingLeft extends SemanticAnimation - case object SwingRight extends SemanticAnimation - case object SwingUp extends SemanticAnimation - case object SwingDown extends SemanticAnimation - case object Browse extends SemanticAnimation - case object BrowseRight extends SemanticAnimation - case object SlideDown extends SemanticAnimation - case object SlideUp extends SemanticAnimation - case object SlideLeft extends SemanticAnimation - case object SlideRight extends SemanticAnimation - case object Jiggle extends SemanticAnimation - case object Flash extends SemanticAnimation - case object Shake extends SemanticAnimation - case object Pulse extends SemanticAnimation - case object Tada extends SemanticAnimation - case object Bounce extends SemanticAnimation - case object Glow extends SemanticAnimation - } - - sealed trait Dismissal extends Product with Serializable - object Dismissal { - case object User extends Dismissal - final case class On(on: FiniteDuration) extends Dismissal - } - - @js.native - trait ToastOptions extends js.Object { - var title: String - var description: js.UndefOr[String] = js.native - var `type`: js.UndefOr[String] = js.native - var icon: js.UndefOr[suiraw.SemanticShorthandItemS[Icon.IconProps]] = js.native - var time: js.UndefOr[JsNumber] = js.native - var animation: js.UndefOr[String] = js.native - var size: js.UndefOr[suiraw.SemanticSIZES] = js.native - var color: js.UndefOr[suiraw.SemanticCOLORS] = js.native - } - - object ToastOptions { - def apply( - title: String, - description: js.UndefOr[String] = js.undefined, - tpe: js.UndefOr[ToastType] = js.undefined, - icon: js.UndefOr[ShorthandS[Icon]] = js.undefined, - time: js.UndefOr[Dismissal] = js.undefined, - animation: js.UndefOr[SemanticAnimation] = js.undefined, - size: js.UndefOr[SemanticSize] = js.undefined, - color: js.UndefOr[SemanticColor] = js.undefined - ): ToastOptions = { - - val p = (new js.Object).asInstanceOf[ToastOptions] - p.title = title - description.foreach(v => p.description = v) - p.`type` = tpe.toJs - icon.toJs.foreach(v => p.icon = v) - time - .map(_ match { - case Dismissal.User => 0 - case Dismissal.On(t) => t.toMillis.toDouble - }) - .foreach(v => p.time = v) - animation.toJs.foreach(v => p.animation = v) - size.toJs.foreach(v => p.size = v) - color.toJs.foreach(v => p.color = v) - p - } - } -} -package object toasts { - type On = Unit => Callback - private type RawEvent = js.Function0[Unit] - - @js.native - @JSImport("react-semantic-toasts", "toast") - private object rawtoasts - extends js.Function4[ToastOptions, js.UndefOr[RawEvent], js.UndefOr[RawEvent], js.UndefOr[ - RawEvent - ], js.Any] { - def apply( - options: ToastOptions, - onClose: js.UndefOr[RawEvent], - onClick: js.UndefOr[RawEvent], - onDismiss: js.UndefOr[RawEvent] - ): js.Any = js.native - } - - def toast( - options: ToastOptions, - onClose: js.UndefOr[Callback] = js.undefined, - onClick: js.UndefOr[Callback] = js.undefined, - onDismiss: js.UndefOr[Callback] = js.undefined - ): js.Any = - rawtoasts(options, onClose.toJs, onClick.toJs, onDismiss.toJs) - - def toastCB( - options: ToastOptions, - onClose: js.UndefOr[Callback] = js.undefined, - onClick: js.UndefOr[Callback] = js.undefined, - onDismiss: js.UndefOr[Callback] = js.undefined - ): Callback = - Callback(rawtoasts(options, onClose.toJs, onClick.toJs, onDismiss.toJs)) - - def toastCB(text: String): Callback = - toastCB(ToastOptions(text)) - -} diff --git a/facade/src/main/scala/react/semanticui/views/card/Card.scala b/facade/src/main/scala/react/semanticui/views/card/Card.scala index 03e5b8b5..2c826fa9 100644 --- a/facade/src/main/scala/react/semanticui/views/card/Card.scala +++ b/facade/src/main/scala/react/semanticui/views/card/Card.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/views/card/CardContent.scala b/facade/src/main/scala/react/semanticui/views/card/CardContent.scala index a9c58a48..e2787e89 100644 --- a/facade/src/main/scala/react/semanticui/views/card/CardContent.scala +++ b/facade/src/main/scala/react/semanticui/views/card/CardContent.scala @@ -5,7 +5,7 @@ import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode import japgolly.scalajs.react.vdom.TagMod -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/views/card/CardDescription.scala b/facade/src/main/scala/react/semanticui/views/card/CardDescription.scala index 5f9dbea8..e901138d 100644 --- a/facade/src/main/scala/react/semanticui/views/card/CardDescription.scala +++ b/facade/src/main/scala/react/semanticui/views/card/CardDescription.scala @@ -5,7 +5,7 @@ import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode import japgolly.scalajs.react.vdom.TagMod -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/views/card/CardGroup.scala b/facade/src/main/scala/react/semanticui/views/card/CardGroup.scala index b09a145e..6925b7c6 100644 --- a/facade/src/main/scala/react/semanticui/views/card/CardGroup.scala +++ b/facade/src/main/scala/react/semanticui/views/card/CardGroup.scala @@ -6,7 +6,7 @@ import js.JSConverters._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode import japgolly.scalajs.react.vdom.TagMod -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/views/card/CardHeader.scala b/facade/src/main/scala/react/semanticui/views/card/CardHeader.scala index cd57fa6b..56a648ee 100644 --- a/facade/src/main/scala/react/semanticui/views/card/CardHeader.scala +++ b/facade/src/main/scala/react/semanticui/views/card/CardHeader.scala @@ -5,7 +5,7 @@ import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode import japgolly.scalajs.react.vdom.TagMod -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/views/card/CardMeta.scala b/facade/src/main/scala/react/semanticui/views/card/CardMeta.scala index 123b26b6..2356a3e2 100644 --- a/facade/src/main/scala/react/semanticui/views/card/CardMeta.scala +++ b/facade/src/main/scala/react/semanticui/views/card/CardMeta.scala @@ -5,7 +5,7 @@ import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode import japgolly.scalajs.react.vdom.TagMod -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/views/item/Item.scala b/facade/src/main/scala/react/semanticui/views/item/Item.scala index 53881080..21ad044f 100644 --- a/facade/src/main/scala/react/semanticui/views/item/Item.scala +++ b/facade/src/main/scala/react/semanticui/views/item/Item.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/views/item/ItemContent.scala b/facade/src/main/scala/react/semanticui/views/item/ItemContent.scala index 01b3fedd..c00961e1 100644 --- a/facade/src/main/scala/react/semanticui/views/item/ItemContent.scala +++ b/facade/src/main/scala/react/semanticui/views/item/ItemContent.scala @@ -5,7 +5,7 @@ import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode import japgolly.scalajs.react.vdom.TagMod -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/views/item/ItemDescription.scala b/facade/src/main/scala/react/semanticui/views/item/ItemDescription.scala index 93c5fd45..c5eb264e 100644 --- a/facade/src/main/scala/react/semanticui/views/item/ItemDescription.scala +++ b/facade/src/main/scala/react/semanticui/views/item/ItemDescription.scala @@ -5,7 +5,7 @@ import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode import japgolly.scalajs.react.vdom.TagMod -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/views/item/ItemExtra.scala b/facade/src/main/scala/react/semanticui/views/item/ItemExtra.scala index 521f652b..d5bb2576 100644 --- a/facade/src/main/scala/react/semanticui/views/item/ItemExtra.scala +++ b/facade/src/main/scala/react/semanticui/views/item/ItemExtra.scala @@ -5,7 +5,7 @@ import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode import japgolly.scalajs.react.vdom.TagMod -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/views/item/ItemGroup.scala b/facade/src/main/scala/react/semanticui/views/item/ItemGroup.scala index a16caba1..00ddb2d8 100644 --- a/facade/src/main/scala/react/semanticui/views/item/ItemGroup.scala +++ b/facade/src/main/scala/react/semanticui/views/item/ItemGroup.scala @@ -7,7 +7,7 @@ import js.JSConverters._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode import japgolly.scalajs.react.vdom.TagMod -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/views/item/ItemHeader.scala b/facade/src/main/scala/react/semanticui/views/item/ItemHeader.scala index ab013610..6d91dd47 100644 --- a/facade/src/main/scala/react/semanticui/views/item/ItemHeader.scala +++ b/facade/src/main/scala/react/semanticui/views/item/ItemHeader.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/main/scala/react/semanticui/views/item/ItemMeta.scala b/facade/src/main/scala/react/semanticui/views/item/ItemMeta.scala index fe98040b..284559c6 100644 --- a/facade/src/main/scala/react/semanticui/views/item/ItemMeta.scala +++ b/facade/src/main/scala/react/semanticui/views/item/ItemMeta.scala @@ -4,7 +4,7 @@ import scala.scalajs.js import js.annotation._ import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.raw.React +import japgolly.scalajs.react.facade.React import react.common._ import react.semanticui._ import react.semanticui.{ raw => suiraw } diff --git a/facade/src/test/scala/react/semanticui/addons/confirm/ConfirmSuite.scala b/facade/src/test/scala/react/semanticui/addons/confirm/ConfirmSuite.scala new file mode 100644 index 00000000..d534e807 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/addons/confirm/ConfirmSuite.scala @@ -0,0 +1,16 @@ +package react.semanticui.addons.confirm + +// import japgolly.scalajs.react.test._ +// import japgolly.scalajs.react.vdom.html_<^._ + +class ConfirmSuite extends munit.FunSuite { + test("render") { + //Modal cannot be tested without anmiationFrame + // val pusher = Confirm(content = "Abc") + // ReactTestUtils.withNewBodyElement { mountNode => + // pusher.renderIntoDOM(mountNode) + // assert(mountNode.outerHTML == """
Abc
""") + // } + assert(true) + } +} diff --git a/facade/src/test/scala/react/semanticui/addons/confirm/ConfirmTests.scala b/facade/src/test/scala/react/semanticui/addons/confirm/ConfirmTests.scala deleted file mode 100644 index a9abcae1..00000000 --- a/facade/src/test/scala/react/semanticui/addons/confirm/ConfirmTests.scala +++ /dev/null @@ -1,19 +0,0 @@ -package react.semanticui.addons.confirm - -import utest._ -// import japgolly.scalajs.react.test._ -// import japgolly.scalajs.react.vdom.html_<^._ - -object ConfirmTests extends TestSuite { - val tests = Tests { - test("render") { - //Modal cannot be tested without anmiationFrame - // val pusher = Confirm(content = "Abc") - // ReactTestUtils.withNewBodyElement { mountNode => - // pusher.renderIntoDOM(mountNode) - // assert(mountNode.outerHTML == """
Abc
""") - // } - assert(true) - } - } -} diff --git a/facade/src/test/scala/react/semanticui/addons/portal/PortalInnerSuite.scala b/facade/src/test/scala/react/semanticui/addons/portal/PortalInnerSuite.scala new file mode 100644 index 00000000..a76ec5e0 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/addons/portal/PortalInnerSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.addons.portal + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.render._ + +class PortalInnerSuite extends munit.FunSuite { + test("render") { + val portal = PortalInner(<.div("Abc")) + ReactTestUtils.withNewBodyElement { mountNode => + portal.renderIntoDOM(mountNode) + assertEquals(mountNode.outerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/addons/portal/PortalInnerTests.scala b/facade/src/test/scala/react/semanticui/addons/portal/PortalInnerTests.scala deleted file mode 100644 index 55d984d4..00000000 --- a/facade/src/test/scala/react/semanticui/addons/portal/PortalInnerTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.addons.portal - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object PortalInnerTests extends TestSuite { - val tests = Tests { - test("render") { - val portal = PortalInner(<.div("Abc")) - ReactTestUtils.withNewBodyElement { mountNode => - portal.renderIntoDOM(mountNode) - assert(mountNode.outerHTML == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/addons/portal/PortalSuite.scala b/facade/src/test/scala/react/semanticui/addons/portal/PortalSuite.scala new file mode 100644 index 00000000..f6e5a6c7 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/addons/portal/PortalSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.addons.portal + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.render._ + +class PortalSuite extends munit.FunSuite { + test("render") { + val portal = Portal(open = true)(<.div("Abc")) + ReactTestUtils.withNewBodyElement { mountNode => + portal.renderIntoDOM(mountNode) + assertEquals(mountNode.outerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/addons/portal/PortalTests.scala b/facade/src/test/scala/react/semanticui/addons/portal/PortalTests.scala deleted file mode 100644 index b980ddab..00000000 --- a/facade/src/test/scala/react/semanticui/addons/portal/PortalTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.addons.portal - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object PortalTests extends TestSuite { - val tests = Tests { - test("render") { - val portal = Portal(open = true)(<.div("Abc")) - ReactTestUtils.withNewBodyElement { mountNode => - portal.renderIntoDOM(mountNode) - assert(mountNode.outerHTML == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/addons/radio/RadioSuite.scala b/facade/src/test/scala/react/semanticui/addons/radio/RadioSuite.scala new file mode 100644 index 00000000..c8ab7e85 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/addons/radio/RadioSuite.scala @@ -0,0 +1,17 @@ +package react.semanticui.addons.radio + +import japgolly.scalajs.react.test._ +import react.common.syntax.render._ + +class RadioSuite extends munit.FunSuite { + test("pusher") { + val check = Radio() + ReactTestUtils.withNewBodyElement { mountNode => + check.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/addons/radio/RadioTests.scala b/facade/src/test/scala/react/semanticui/addons/radio/RadioTests.scala deleted file mode 100644 index c2949681..00000000 --- a/facade/src/test/scala/react/semanticui/addons/radio/RadioTests.scala +++ /dev/null @@ -1,18 +0,0 @@ -package react.semanticui.addons.radio - -import utest._ -import japgolly.scalajs.react.test._ - -object RadioTests extends TestSuite { - val tests = Tests { - test("pusher") { - val check = Radio() - ReactTestUtils.withNewBodyElement { mountNode => - check.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/addons/select/SelectSuite.scala b/facade/src/test/scala/react/semanticui/addons/select/SelectSuite.scala new file mode 100644 index 00000000..dda8f7e2 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/addons/select/SelectSuite.scala @@ -0,0 +1,21 @@ +package react.semanticui.addons.select + +import japgolly.scalajs.react.test._ +import react.semanticui.modules.dropdown.DropdownItem +import react.common.syntax.render._ + +class SelectSuite extends munit.FunSuite { + test("options") { + val options = + List(DropdownItem("abc"), DropdownItem(text = "def", value = 2, selected = true)) + val select = Select(options = options) + ReactTestUtils.withNewBodyElement { mountNode => + select.renderIntoDOM(mountNode) + val html = mountNode.outerHTML + assertEquals( + html, + """
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/addons/select/SelectTests.scala b/facade/src/test/scala/react/semanticui/addons/select/SelectTests.scala deleted file mode 100644 index 8039b0cc..00000000 --- a/facade/src/test/scala/react/semanticui/addons/select/SelectTests.scala +++ /dev/null @@ -1,22 +0,0 @@ -package react.semanticui.addons.select - -import utest._ -import japgolly.scalajs.react.test._ -import react.semanticui.modules.dropdown.DropdownItem - -object SelectTests extends TestSuite { - val tests = Tests { - test("options") { - val options = - List(DropdownItem("abc"), DropdownItem(text = "def", value = 2, selected = true)) - val select = Select(options = options) - ReactTestUtils.withNewBodyElement { mountNode => - select.renderIntoDOM(mountNode) - val html = mountNode.outerHTML - assert( - html == """
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/addons/textarea/TextAreaSuite.scala b/facade/src/test/scala/react/semanticui/addons/textarea/TextAreaSuite.scala new file mode 100644 index 00000000..825f8cbd --- /dev/null +++ b/facade/src/test/scala/react/semanticui/addons/textarea/TextAreaSuite.scala @@ -0,0 +1,27 @@ +package react.semanticui.addons.textarea + +import japgolly.scalajs.react.test._ +import react.common.syntax.render._ + +class TextAreaSuite extends munit.FunSuite { + test("render") { + val check = TextArea() + ReactTestUtils.withNewBodyElement { mountNode => + check.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } + test("value") { + val check = TextArea(rows = 10, value = "Some text") + ReactTestUtils.withNewBodyElement { mountNode => + check.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/addons/textarea/TextAreaTests.scala b/facade/src/test/scala/react/semanticui/addons/textarea/TextAreaTests.scala deleted file mode 100644 index b9580e72..00000000 --- a/facade/src/test/scala/react/semanticui/addons/textarea/TextAreaTests.scala +++ /dev/null @@ -1,27 +0,0 @@ -package react.semanticui.addons.textarea - -import utest._ -import japgolly.scalajs.react.test._ - -object TextAreaTests extends TestSuite { - val tests = Tests { - test("render") { - val check = TextArea() - ReactTestUtils.withNewBodyElement { mountNode => - check.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } - } - test("value") { - val check = TextArea(rows = 10, value = "Some text") - ReactTestUtils.withNewBodyElement { mountNode => - check.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormButtonSuite.scala b/facade/src/test/scala/react/semanticui/collections/form/FormButtonSuite.scala new file mode 100644 index 00000000..07fcd0c1 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/form/FormButtonSuite.scala @@ -0,0 +1,44 @@ +package react.semanticui.collections.form + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.widths._ +import react.semanticui.elements.label.Label +import react.semanticui.elements.button.LabelPosition +import react.common.syntax.vdom._ + +class FormButtonSuite extends munit.FunSuite { + test("render") { + val form = FormButton() + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("width") { + val form = FormButton(width = Two) + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("label") { + val form = + FormButton(width = Two, label = Label(content = "label"), labelPosition = LabelPosition.Left)( + "Press" + ) + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormButtonTests.scala b/facade/src/test/scala/react/semanticui/collections/form/FormButtonTests.scala deleted file mode 100644 index e5ea9ef2..00000000 --- a/facade/src/test/scala/react/semanticui/collections/form/FormButtonTests.scala +++ /dev/null @@ -1,44 +0,0 @@ -package react.semanticui.collections.form - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.widths._ -import react.semanticui.elements.label.Label -import react.semanticui.elements.button.LabelPosition - -object FormButtonTests extends TestSuite { - val tests = Tests { - test("render") { - val form = FormButton() - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("width") { - val form = FormButton(width = Two) - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("label") { - val form = - FormButton(width = Two, - label = Label(content = "label"), - labelPosition = LabelPosition.Left - )("Press") - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormCheckboxSuite.scala b/facade/src/test/scala/react/semanticui/collections/form/FormCheckboxSuite.scala new file mode 100644 index 00000000..5a6642fa --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/form/FormCheckboxSuite.scala @@ -0,0 +1,39 @@ +package react.semanticui.collections.form + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.widths._ +import react.common.syntax.vdom._ + +class FormCheckboxSuite extends munit.FunSuite { + test("render") { + val form = FormCheckbox() + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("width") { + val form = FormCheckbox(width = Two) + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("value") { + val form = FormCheckbox(width = Two, value = 1, slider = true) + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormCheckboxTests.scala b/facade/src/test/scala/react/semanticui/collections/form/FormCheckboxTests.scala deleted file mode 100644 index 407d6b1b..00000000 --- a/facade/src/test/scala/react/semanticui/collections/form/FormCheckboxTests.scala +++ /dev/null @@ -1,38 +0,0 @@ -package react.semanticui.collections.form - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.widths._ - -object FormCheckboxTests extends TestSuite { - val tests = Tests { - test("render") { - val form = FormCheckbox() - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("width") { - val form = FormCheckbox(width = Two) - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("value") { - val form = FormCheckbox(width = Two, value = 1, slider = true) - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormDropdownTests.scala b/facade/src/test/scala/react/semanticui/collections/form/FormDropdownTests.scala index cac42c0f..903b09f4 100644 --- a/facade/src/test/scala/react/semanticui/collections/form/FormDropdownTests.scala +++ b/facade/src/test/scala/react/semanticui/collections/form/FormDropdownTests.scala @@ -1,32 +1,32 @@ package react.semanticui.collections.form -import utest._ import japgolly.scalajs.react.test._ import react.semanticui.modules.dropdown.DropdownItem import react.semanticui.widths._ +import react.common.syntax.vdom._ -object FormDropdownTests extends TestSuite { - val tests = Tests { - test("dropdown") { - val dropdown = FormDropdown() - ReactTestUtils.withNewBodyElement { mountNode => - dropdown.renderIntoDOM(mountNode) - assert( - mountNode.outerHTML == """
""" - ) - } +class FormDropdownSuite extends munit.FunSuite { + test("dropdown") { + val dropdown = FormDropdown() + ReactTestUtils.withNewBodyElement { mountNode => + dropdown.renderIntoDOM(mountNode) + assertEquals( + mountNode.outerHTML, + """
""" + ) } - test("options") { - val options = - List(DropdownItem("abc"), DropdownItem(text = "def", value = 2)) - val dropdown = FormDropdown(width = Two, options = options) - ReactTestUtils.withNewBodyElement { mountNode => - dropdown.renderIntoDOM(mountNode) - val html = mountNode.outerHTML - assert( - html == """
""" - ) - } + } + test("options") { + val options = + List(DropdownItem("abc"), DropdownItem(text = "def", value = 2)) + val dropdown = FormDropdown(width = Two, options = options) + ReactTestUtils.withNewBodyElement { mountNode => + dropdown.renderIntoDOM(mountNode) + val html = mountNode.outerHTML + assertEquals( + html, + """
""" + ) } } } diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormFieldSuite.scala b/facade/src/test/scala/react/semanticui/collections/form/FormFieldSuite.scala new file mode 100644 index 00000000..19727729 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/form/FormFieldSuite.scala @@ -0,0 +1,22 @@ +package react.semanticui.collections.form + +import japgolly.scalajs.react.test._ +import react.semanticui.widths._ +import react.common.syntax.vdom._ + +class FormFieldSuite extends munit.FunSuite { + test("render") { + val form = FormField() + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("width") { + val form = FormField(width = Two) + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormFieldTests.scala b/facade/src/test/scala/react/semanticui/collections/form/FormFieldTests.scala deleted file mode 100644 index dd2e01b2..00000000 --- a/facade/src/test/scala/react/semanticui/collections/form/FormFieldTests.scala +++ /dev/null @@ -1,24 +0,0 @@ -package react.semanticui.collections.form - -import utest._ -import japgolly.scalajs.react.test._ -import react.semanticui.widths._ - -object FormFieldTests extends TestSuite { - val tests = Tests { - test("render") { - val form = FormField() - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("width") { - val form = FormField(width = Two) - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormGroupSuite.scala b/facade/src/test/scala/react/semanticui/collections/form/FormGroupSuite.scala new file mode 100644 index 00000000..5d805bbc --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/form/FormGroupSuite.scala @@ -0,0 +1,22 @@ +package react.semanticui.collections.form + +import japgolly.scalajs.react.test._ +import react.semanticui.widths._ +import react.common.syntax.vdom._ + +class FormGroupSuite extends munit.FunSuite { + test("render") { + val form = FormGroup() + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("width") { + val form = FormGroup(widths = Two) + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormGroupTests.scala b/facade/src/test/scala/react/semanticui/collections/form/FormGroupTests.scala deleted file mode 100644 index 27a044f2..00000000 --- a/facade/src/test/scala/react/semanticui/collections/form/FormGroupTests.scala +++ /dev/null @@ -1,24 +0,0 @@ -package react.semanticui.collections.form - -import utest._ -import japgolly.scalajs.react.test._ -import react.semanticui.widths._ - -object FormGroupTests extends TestSuite { - val tests = Tests { - test("render") { - val form = FormGroup() - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("width") { - val form = FormGroup(widths = Two) - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormInputSuite.scala b/facade/src/test/scala/react/semanticui/collections/form/FormInputSuite.scala new file mode 100644 index 00000000..93da25af --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/form/FormInputSuite.scala @@ -0,0 +1,39 @@ +package react.semanticui.collections.form + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.widths._ +import react.common.syntax.vdom._ + +class FormInputSuite extends munit.FunSuite { + test("render") { + val form = FormInput() + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("width") { + val form = FormInput(width = Two) + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("value") { + val form = FormInput(width = Two, inverted = true, focus = true, value = "test") + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormInputTests.scala b/facade/src/test/scala/react/semanticui/collections/form/FormInputTests.scala deleted file mode 100644 index 99f6239d..00000000 --- a/facade/src/test/scala/react/semanticui/collections/form/FormInputTests.scala +++ /dev/null @@ -1,38 +0,0 @@ -package react.semanticui.collections.form - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.widths._ - -object FormInputTests extends TestSuite { - val tests = Tests { - test("render") { - val form = FormInput() - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("width") { - val form = FormInput(width = Two) - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("value") { - val form = FormInput(width = Two, inverted = true, focus = true, value = "test") - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormSelectSuite.scala b/facade/src/test/scala/react/semanticui/collections/form/FormSelectSuite.scala new file mode 100644 index 00000000..48bd7ecf --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/form/FormSelectSuite.scala @@ -0,0 +1,22 @@ +package react.semanticui.collections.form + +import japgolly.scalajs.react.test._ +import react.semanticui.modules.dropdown.DropdownItem +import react.semanticui.widths._ +import react.common.syntax.vdom._ + +class FormSelectSuite extends munit.FunSuite { + test("options") { + val options = + List(DropdownItem("abc"), DropdownItem(text = "def", value = 2)) + val select = FormSelect(width = Two, options = options) + ReactTestUtils.withNewBodyElement { mountNode => + select.renderIntoDOM(mountNode) + val html = mountNode.outerHTML + assertEquals( + html, + """
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormSelectTests.scala b/facade/src/test/scala/react/semanticui/collections/form/FormSelectTests.scala deleted file mode 100644 index ce0a2ece..00000000 --- a/facade/src/test/scala/react/semanticui/collections/form/FormSelectTests.scala +++ /dev/null @@ -1,23 +0,0 @@ -package react.semanticui.collections.form - -import utest._ -import japgolly.scalajs.react.test._ -import react.semanticui.modules.dropdown.DropdownItem -import react.semanticui.widths._ - -object FormSelectTests extends TestSuite { - val tests = Tests { - test("options") { - val options = - List(DropdownItem("abc"), DropdownItem(text = "def", value = 2)) - val select = FormSelect(width = Two, options = options) - ReactTestUtils.withNewBodyElement { mountNode => - select.renderIntoDOM(mountNode) - val html = mountNode.outerHTML - assert( - html == """
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormSuite.scala b/facade/src/test/scala/react/semanticui/collections/form/FormSuite.scala new file mode 100644 index 00000000..45c2fc43 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/form/FormSuite.scala @@ -0,0 +1,14 @@ +package react.semanticui.collections.form + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class FormSuite extends munit.FunSuite { + test("render") { + val form = Form() + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormTests.scala b/facade/src/test/scala/react/semanticui/collections/form/FormTests.scala deleted file mode 100644 index d2f224bd..00000000 --- a/facade/src/test/scala/react/semanticui/collections/form/FormTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.collections.form - -import utest._ -import japgolly.scalajs.react.test._ - -object FormTests extends TestSuite { - val tests = Tests { - test("render") { - val form = Form() - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormTextAreaSuite.scala b/facade/src/test/scala/react/semanticui/collections/form/FormTextAreaSuite.scala new file mode 100644 index 00000000..ee74dcd7 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/form/FormTextAreaSuite.scala @@ -0,0 +1,39 @@ +package react.semanticui.collections.form + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.widths._ +import react.common.syntax.vdom._ + +class FormTextAreaSuite extends munit.FunSuite { + test("render") { + val form = FormTextArea() + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("width") { + val form = FormTextArea(width = Two) + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("value") { + val form = FormTextArea(width = Two, value = "test") + ReactTestUtils.withNewBodyElement { mountNode => + form.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/form/FormTextAreaTests.scala b/facade/src/test/scala/react/semanticui/collections/form/FormTextAreaTests.scala deleted file mode 100644 index dc7a73ca..00000000 --- a/facade/src/test/scala/react/semanticui/collections/form/FormTextAreaTests.scala +++ /dev/null @@ -1,38 +0,0 @@ -package react.semanticui.collections.form - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.widths._ - -object FormTextAreaTests extends TestSuite { - val tests = Tests { - test("render") { - val form = FormTextArea() - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("width") { - val form = FormTextArea(width = Two) - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("value") { - val form = FormTextArea(width = Two, value = "test") - ReactTestUtils.withNewBodyElement { mountNode => - form.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/grid/GridColumnSuite.scala b/facade/src/test/scala/react/semanticui/collections/grid/GridColumnSuite.scala new file mode 100644 index 00000000..fe16f488 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/grid/GridColumnSuite.scala @@ -0,0 +1,14 @@ +package react.semanticui.collections.grid + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class GridColumnSuite extends munit.FunSuite { + test("render") { + val gridColumn = GridColumn() + ReactTestUtils.withNewBodyElement { mountNode => + gridColumn.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/grid/GridColumnTests.scala b/facade/src/test/scala/react/semanticui/collections/grid/GridColumnTests.scala deleted file mode 100644 index ececbb2f..00000000 --- a/facade/src/test/scala/react/semanticui/collections/grid/GridColumnTests.scala +++ /dev/null @@ -1,16 +0,0 @@ -package react.semanticui.collections.grid - -import utest._ -import japgolly.scalajs.react.test._ - -object GridColumnTests extends TestSuite { - val tests = Tests { - test("render") { - val gridColumn = GridColumn() - ReactTestUtils.withNewBodyElement { mountNode => - gridColumn.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/grid/GridRowSuite.scala b/facade/src/test/scala/react/semanticui/collections/grid/GridRowSuite.scala new file mode 100644 index 00000000..b6d4e289 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/grid/GridRowSuite.scala @@ -0,0 +1,37 @@ +package react.semanticui.collections.grid + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.widths._ +import react.common.syntax.vdom._ + +class GridRowSuite extends munit.FunSuite { + test("render") { + val gridRow = GridRow() + ReactTestUtils.withNewBodyElement { mountNode => + gridRow.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderChild") { + val gridRow = GridRow(<.div("abc")) + ReactTestUtils.withNewBodyElement { mountNode => + gridRow.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
abc
""") + } + } + test("columns") { + val gridRow = GridRow(columns = Three) + ReactTestUtils.withNewBodyElement { mountNode => + gridRow.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("columns equal") { + val gridRow = GridRow(columns = GridColumns.Equal) + ReactTestUtils.withNewBodyElement { mountNode => + gridRow.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/grid/GridRowTests.scala b/facade/src/test/scala/react/semanticui/collections/grid/GridRowTests.scala deleted file mode 100644 index 4a9e6848..00000000 --- a/facade/src/test/scala/react/semanticui/collections/grid/GridRowTests.scala +++ /dev/null @@ -1,39 +0,0 @@ -package react.semanticui.collections.grid - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.widths._ - -object GridRowTests extends TestSuite { - val tests = Tests { - test("render") { - val gridRow = GridRow() - ReactTestUtils.withNewBodyElement { mountNode => - gridRow.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderChild") { - val gridRow = GridRow(<.div("abc")) - ReactTestUtils.withNewBodyElement { mountNode => - gridRow.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
abc
""") - } - } - test("columns") { - val gridRow = GridRow(columns = Three) - ReactTestUtils.withNewBodyElement { mountNode => - gridRow.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("columns equal") { - val gridRow = GridRow(columns = GridColumns.Equal) - ReactTestUtils.withNewBodyElement { mountNode => - gridRow.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/grid/GridSuite.scala b/facade/src/test/scala/react/semanticui/collections/grid/GridSuite.scala new file mode 100644 index 00000000..d0b3952a --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/grid/GridSuite.scala @@ -0,0 +1,14 @@ +package react.semanticui.collections.grid + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class GridSuite extends munit.FunSuite { + test("render") { + val grid = Grid() + ReactTestUtils.withNewBodyElement { mountNode => + grid.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/grid/GridTests.scala b/facade/src/test/scala/react/semanticui/collections/grid/GridTests.scala deleted file mode 100644 index 26772c3a..00000000 --- a/facade/src/test/scala/react/semanticui/collections/grid/GridTests.scala +++ /dev/null @@ -1,16 +0,0 @@ -package react.semanticui.collections.grid - -import utest._ -import japgolly.scalajs.react.test._ - -object GridTests extends TestSuite { - val tests = Tests { - test("render") { - val grid = Grid() - ReactTestUtils.withNewBodyElement { mountNode => - grid.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/menu/MenuHeaderSuite.scala b/facade/src/test/scala/react/semanticui/collections/menu/MenuHeaderSuite.scala new file mode 100644 index 00000000..2379db53 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/menu/MenuHeaderSuite.scala @@ -0,0 +1,29 @@ +package react.semanticui.collections.menu + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class MenuHeaderSuite extends munit.FunSuite { + test("render") { + val menuHeader = MenuHeader() + ReactTestUtils.withNewBodyElement { mountNode => + menuHeader.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderAsTag") { + val menuHeader = MenuHeader(as = <.a) + ReactTestUtils.withNewBodyElement { mountNode => + menuHeader.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } + test("renderAsHTMLTag") { + val menuHeader = MenuHeader(as = <.div) + ReactTestUtils.withNewBodyElement { mountNode => + menuHeader.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/menu/MenuHeaderTests.scala b/facade/src/test/scala/react/semanticui/collections/menu/MenuHeaderTests.scala deleted file mode 100644 index 08ae72f2..00000000 --- a/facade/src/test/scala/react/semanticui/collections/menu/MenuHeaderTests.scala +++ /dev/null @@ -1,31 +0,0 @@ -package react.semanticui.collections.menu - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object MenuHeaderTests extends TestSuite { - val tests = Tests { - test("render") { - val menuHeader = MenuHeader() - ReactTestUtils.withNewBodyElement { mountNode => - menuHeader.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderAsTag") { - val menuHeader = MenuHeader(as = <.a) - ReactTestUtils.withNewBodyElement { mountNode => - menuHeader.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - test("renderAsHTMLTag") { - val menuHeader = MenuHeader(as = <.div) - ReactTestUtils.withNewBodyElement { mountNode => - menuHeader.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/menu/MenuItemSuite.scala b/facade/src/test/scala/react/semanticui/collections/menu/MenuItemSuite.scala new file mode 100644 index 00000000..b8ca0732 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/menu/MenuItemSuite.scala @@ -0,0 +1,42 @@ +package react.semanticui.collections.menu + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.elements.icon._ +import react.common.style.Css +import react.common.syntax.vdom._ + +class MenuItemSuite extends munit.FunSuite { + test("render") { + val menuItem = MenuItem() + ReactTestUtils.withNewBodyElement { m => + menuItem.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("renderAs") { + val menuItem = MenuItem(as = "a") + ReactTestUtils.withNewBodyElement { m => + menuItem.renderIntoDOM(m) + assertEquals(m.innerHTML, """""") + } + } + test("renderAsTag") { + val menuItem = MenuItem(as = <.a, icon = Icon(name = "comment")) + ReactTestUtils.withNewBodyElement { m => + menuItem.renderIntoDOM(m) + assertEquals( + m.innerHTML, + """""" + ) + } + } + test("apply") { + val menuItem = MenuItem(clazz = Css("my-class"))(<.div, <.span) + ReactTestUtils.withNewBodyElement { m => + menuItem.renderIntoDOM(m) + val html = m.innerHTML + assertEquals(html, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/menu/MenuItemTests.scala b/facade/src/test/scala/react/semanticui/collections/menu/MenuItemTests.scala deleted file mode 100644 index ac029cf5..00000000 --- a/facade/src/test/scala/react/semanticui/collections/menu/MenuItemTests.scala +++ /dev/null @@ -1,39 +0,0 @@ -package react.semanticui.collections.menu - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.elements.icon._ -import react.common.style.Css - -object MenuItemTests extends TestSuite { - val tests = Tests { - test("render") { - val menuItem = MenuItem() - ReactTestUtils.withRenderedIntoDocument(menuItem) { m => - assert(m.outerHtmlScrubbed() == """
""") - } - } - test("renderAs") { - val button = MenuItem(as = "a") - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert(m.outerHtmlScrubbed() == """""") - } - } - test("renderAsTag") { - val button = MenuItem(as = <.a, icon = Icon(name = "comment")) - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert( - m.outerHtmlScrubbed() == """""" - ) - } - } - test("apply") { - val menuItem = MenuItem(clazz = Css("my-class"))(<.div, <.span) - ReactTestUtils.withRenderedIntoDocument(menuItem) { m => - val html = m.outerHtmlScrubbed() - assert(html == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/menu/MenuMenuSuite.scala b/facade/src/test/scala/react/semanticui/collections/menu/MenuMenuSuite.scala new file mode 100644 index 00000000..db174fb9 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/menu/MenuMenuSuite.scala @@ -0,0 +1,22 @@ +package react.semanticui.collections.menu + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class MenuMenuSuite extends munit.FunSuite { + test("render") { + val menumenu = MenuMenu() + ReactTestUtils.withNewBodyElement { mountNode => + menumenu.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } + test("renderAs") { + val menumenu = MenuMenu(as = <.a) + ReactTestUtils.withNewBodyElement { mountNode => + menumenu.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/menu/MenuMenuTests.scala b/facade/src/test/scala/react/semanticui/collections/menu/MenuMenuTests.scala deleted file mode 100644 index 2e165be3..00000000 --- a/facade/src/test/scala/react/semanticui/collections/menu/MenuMenuTests.scala +++ /dev/null @@ -1,24 +0,0 @@ -package react.semanticui.collections.menu - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object MenuMenuTests extends TestSuite { - val tests = Tests { - test("render") { - val menumenu = MenuMenu() - ReactTestUtils.withNewBodyElement { mountNode => - menumenu.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - test("renderAs") { - val menumenu = MenuMenu(as = <.a) - ReactTestUtils.withNewBodyElement { mountNode => - menumenu.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/menu/MenuSuite.scala b/facade/src/test/scala/react/semanticui/collections/menu/MenuSuite.scala new file mode 100644 index 00000000..63dcedc9 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/menu/MenuSuite.scala @@ -0,0 +1,37 @@ +package react.semanticui.collections.menu + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.style.Css +import react.common.syntax.vdom._ + +class MenuSuite extends munit.FunSuite { + test("render") { + val menu = Menu() + ReactTestUtils.withNewBodyElement { m => + menu.renderIntoDOM(m) + assertEquals(m.innerHTML, """""") + } + } + test("renderAs") { + val menu = Menu(as = <.a) + ReactTestUtils.withNewBodyElement { m => + menu.renderIntoDOM(m) + assertEquals(m.innerHTML, """""") + } + } + test("applyItems") { + val menu = Menu( + MenuHeader(), + MenuItem(clazz = Css("my-class"))(<.div, <.span) + ) + ReactTestUtils.withNewBodyElement { m => + menu.renderIntoDOM(m) + val html = m.innerHTML + assertEquals( + html, + """""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/menu/MenuTests.scala b/facade/src/test/scala/react/semanticui/collections/menu/MenuTests.scala deleted file mode 100644 index 9b55646a..00000000 --- a/facade/src/test/scala/react/semanticui/collections/menu/MenuTests.scala +++ /dev/null @@ -1,35 +0,0 @@ -package react.semanticui.collections.menu - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.common.style.Css - -object MenuTests extends TestSuite { - val tests = Tests { - test("render") { - val menu = Menu() - ReactTestUtils.withRenderedIntoDocument(menu) { m => - assert(m.outerHtmlScrubbed() == """""") - } - } - test("renderAs") { - val menu = Menu(as = <.a) - ReactTestUtils.withRenderedIntoDocument(menu) { m => - assert(m.outerHtmlScrubbed() == """""") - } - } - test("applyItems") { - val menu = Menu( - MenuHeader(), - MenuItem(clazz = Css("my-class"))(<.div, <.span) - ) - ReactTestUtils.withRenderedIntoDocument(menu) { m => - val html = m.outerHtmlScrubbed() - assert( - html == """""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/message/MessageSuite.scala b/facade/src/test/scala/react/semanticui/collections/message/MessageSuite.scala new file mode 100644 index 00000000..36a44086 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/message/MessageSuite.scala @@ -0,0 +1,94 @@ +package react.semanticui.collections.message + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class MessageSuite extends munit.FunSuite { + test("render") { + val message = Message() + ReactTestUtils.withNewBodyElement { mountNode => + message.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """
""") + } + } + + test("header") { + val message = Message( + MessageHeader() + ) + ReactTestUtils.withNewBodyElement { mountNode => + message.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """
""") + } + } + + test("headerShorthand") { + val message = Message( + header = "" + ) + ReactTestUtils.withNewBodyElement { mountNode => + message.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
""" + ) + } + } + + test("content") { + val message = Message( + MessageContent() + ) + ReactTestUtils.withNewBodyElement { mountNode => + message.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """
""") + } + } + + test("contentShorthand") { + val message = Message( + content = "" + ) + ReactTestUtils.withNewBodyElement { mountNode => + message.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """

""") + } + } + + test("list") { + val message = Message( + MessageList( + MessageItem(""), + MessageItem("") + ) + ) + ReactTestUtils.withNewBodyElement { mountNode => + message.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
""" + ) + } + } + + test("listShorthand") { + val message = Message( + list = List("a", "b") + ) + ReactTestUtils.withNewBodyElement { mountNode => + message.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/message/MessageTests.scala b/facade/src/test/scala/react/semanticui/collections/message/MessageTests.scala deleted file mode 100644 index 77747800..00000000 --- a/facade/src/test/scala/react/semanticui/collections/message/MessageTests.scala +++ /dev/null @@ -1,93 +0,0 @@ -package react.semanticui.collections.message - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object MessageTests extends TestSuite { - val tests = Tests { - test("render") { - val message = Message() - ReactTestUtils.withNewBodyElement { mountNode => - message.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert(html == """
""") - } - } - - test("header") { - val message = Message( - MessageHeader() - ) - ReactTestUtils.withNewBodyElement { mountNode => - message.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert(html == """
""") - } - } - - test("headerShorthand") { - val message = Message( - header = "" - ) - ReactTestUtils.withNewBodyElement { mountNode => - message.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert( - html == """
""" - ) - } - } - - test("content") { - val message = Message( - MessageContent() - ) - ReactTestUtils.withNewBodyElement { mountNode => - message.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert(html == """
""") - } - } - - test("contentShorthand") { - val message = Message( - content = "" - ) - ReactTestUtils.withNewBodyElement { mountNode => - message.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert(html == """

""") - } - } - - test("list") { - val message = Message( - MessageList( - MessageItem(""), - MessageItem("") - ) - ) - ReactTestUtils.withNewBodyElement { mountNode => - message.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert( - html == """
""" - ) - } - } - - test("listShorthand") { - val message = Message( - list = List("a", "b") - ) - ReactTestUtils.withNewBodyElement { mountNode => - message.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert( - html == """
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableBodySuite.scala b/facade/src/test/scala/react/semanticui/collections/table/TableBodySuite.scala new file mode 100644 index 00000000..0d4caec5 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/table/TableBodySuite.scala @@ -0,0 +1,19 @@ +package react.semanticui.collections.table + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class TableBodySuite extends munit.FunSuite { + test("TableBody") { + val row1 = TableRow(TableCell("one")) + val row2 = TableRow(TableCell("two")) + val body = TableBody(row1, row2) + ReactTestUtils.withNewBodyElement { mountNode => + body.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """onetwo""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableBodyTests.scala b/facade/src/test/scala/react/semanticui/collections/table/TableBodyTests.scala deleted file mode 100644 index 116bb301..00000000 --- a/facade/src/test/scala/react/semanticui/collections/table/TableBodyTests.scala +++ /dev/null @@ -1,20 +0,0 @@ -package react.semanticui.collections.table - -import japgolly.scalajs.react.test._ -import utest._ - -object TableBodyTests extends TestSuite { - val tests = Tests { - test("TableBody") { - val row1 = TableRow(TableCell("one")) - val row2 = TableRow(TableCell("two")) - val body = TableBody(row1, row2) - ReactTestUtils.withNewBodyElement { mountNode => - body.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """onetwo""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableCellSuite.scala b/facade/src/test/scala/react/semanticui/collections/table/TableCellSuite.scala new file mode 100644 index 00000000..cf1cbf30 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/table/TableCellSuite.scala @@ -0,0 +1,146 @@ +package react.semanticui.collections.table + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.elements.icon._ +import react.semanticui.verticalalignment +import react.semanticui.widths +import react.common.syntax.vdom._ + +class TableCellSuite extends munit.FunSuite { + test("default") { + val cell = TableCell(content = "Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("object apply") { + val cell = TableCell("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("active") { + val cell = TableCell(active = true, content = <.div("Some Content")) + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Some Content
""") + } + } + test("collapsing") { + val cell = TableCell(collapsing = true, content = "Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("disabled") { + val cell = TableCell(disabled = true)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("error") { + val cell = TableCell(error = true)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("icon") { + val cell = TableCell(icon = Icon("edit"), content = "Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """Some Content""" + ) + } + } + test("negative") { + val cell = TableCell(negative = true)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("positive") { + val cell = TableCell(positive = true)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("selectable") { + val cell = TableCell(selectable = true)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("singleLine") { + val cell = TableCell(singleLine = true)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("textAlign Center") { + val cell = TableCell(textAlign = TableTextAlign.Center)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("textAlign Right") { + val cell = TableCell(textAlign = TableTextAlign.Right)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("textAlign Left") { + val cell = TableCell(textAlign = TableTextAlign.Left)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("verticalAlign") { + val cell = TableCell(verticalAlign = verticalalignment.Top)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("aligned both") { + val cell = + TableCell(textAlign = TableTextAlign.Center, verticalAlign = verticalalignment.Middle)( + "Some Content" + ) + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """Some Content""" + ) + } + } + test("warning") { + val cell = TableCell(warning = true)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("width") { + val cell = TableCell(width = widths.One)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableCellTests.scala b/facade/src/test/scala/react/semanticui/collections/table/TableCellTests.scala deleted file mode 100644 index 0fea1669..00000000 --- a/facade/src/test/scala/react/semanticui/collections/table/TableCellTests.scala +++ /dev/null @@ -1,146 +0,0 @@ -package react.semanticui.collections.table - -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.elements.icon._ -import react.semanticui.verticalalignment -import react.semanticui.widths -import utest._ - -object TableCellTests extends TestSuite { - val tests = Tests { - test("default") { - val cell = TableCell(content = "Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("object apply") { - val cell = TableCell("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("active") { - val cell = TableCell(active = true, content = <.div("Some Content")) - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Some Content
""") - } - } - test("collapsing") { - val cell = TableCell(collapsing = true, content = "Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("disabled") { - val cell = TableCell(disabled = true)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("error") { - val cell = TableCell(error = true)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("icon") { - val cell = TableCell(icon = Icon("edit"), content = "Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """Some Content""" - ) - } - } - test("negative") { - val cell = TableCell(negative = true)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("positive") { - val cell = TableCell(positive = true)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("selectable") { - val cell = TableCell(selectable = true)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("singleLine") { - val cell = TableCell(singleLine = true)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("textAlign Center") { - val cell = TableCell(textAlign = TableTextAlign.Center)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("textAlign Right") { - val cell = TableCell(textAlign = TableTextAlign.Right)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("textAlign Left") { - val cell = TableCell(textAlign = TableTextAlign.Left)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("verticalAlign") { - val cell = TableCell(verticalAlign = verticalalignment.Top)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("aligned both") { - val cell = - TableCell(textAlign = TableTextAlign.Center, verticalAlign = verticalalignment.Middle)( - "Some Content" - ) - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """Some Content""" - ) - } - } - test("warning") { - val cell = TableCell(warning = true)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("width") { - val cell = TableCell(width = widths.One)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableFooterSuite.scala b/facade/src/test/scala/react/semanticui/collections/table/TableFooterSuite.scala new file mode 100644 index 00000000..f0dfaef7 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/table/TableFooterSuite.scala @@ -0,0 +1,31 @@ +package react.semanticui.collections.table + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class TableFooterSuite extends munit.FunSuite { + test("TableFooter") { + val row1 = TableRow(TableCell("one")) + val row2 = TableRow(TableCell("two")) + val body = TableFooter(row1, row2) + ReactTestUtils.withNewBodyElement { mountNode => + body.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """onetwo""" + ) + } + } + test("fullWidth") { + val row1 = TableRow(TableCell("one")) + val row2 = TableRow(TableCell("two")) + val body = TableFooter(fullWidth = true)(row1, row2) + ReactTestUtils.withNewBodyElement { mountNode => + body.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """onetwo""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableFooterTests.scala b/facade/src/test/scala/react/semanticui/collections/table/TableFooterTests.scala deleted file mode 100644 index c9e114cb..00000000 --- a/facade/src/test/scala/react/semanticui/collections/table/TableFooterTests.scala +++ /dev/null @@ -1,31 +0,0 @@ -package react.semanticui.collections.table - -import japgolly.scalajs.react.test._ -import utest._ - -object TableFooterTests extends TestSuite { - val tests = Tests { - test("TableFooter") { - val row1 = TableRow(TableCell("one")) - val row2 = TableRow(TableCell("two")) - val body = TableFooter(row1, row2) - ReactTestUtils.withNewBodyElement { mountNode => - body.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """onetwo""" - ) - } - } - test("fullWidth") { - val row1 = TableRow(TableCell("one")) - val row2 = TableRow(TableCell("two")) - val body = TableFooter(fullWidth = true)(row1, row2) - ReactTestUtils.withNewBodyElement { mountNode => - body.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """onetwo""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableGeneratorSuite.scala b/facade/src/test/scala/react/semanticui/collections/table/TableGeneratorSuite.scala new file mode 100644 index 00000000..8e549cd4 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/table/TableGeneratorSuite.scala @@ -0,0 +1,41 @@ +package react.semanticui.collections.table + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class TableGeneratorSuite extends munit.FunSuite { + test("TableGenerator headerRow") { + def makeRow(a: String, i: Int) = TableRow(TableCell(i.toString), TableCell(a)) + val headerRow = TableRow(TableHeaderCell("header 1"), TableHeaderCell("header 2")) + val footerRow = TableRow(TableCell("footer 1"), TableCell("footer 2")) + val table = + TableGenerator[String](tableData = Seq("a", "b"), + renderBodyRow = makeRow _, + headerRow = headerRow, + footerRow = footerRow + ) + ReactTestUtils.withNewBodyElement { mountNode => + table.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
header 1header 2
0a
1b
footer 1footer 2
""" + ) + } + } + test("TableGenerator headerRows") { + def makeRow(a: String, i: Int) = TableRow(TableCell(i.toString), TableCell(a)) + val headerRows = Seq(TableRow(TableHeaderCell("Row 1")), TableRow(TableHeaderCell("Row 2"))) + val table = + TableGenerator[String](tableData = Seq("a", "b"), + renderBodyRow = makeRow _, + headerRows = headerRows + ) + ReactTestUtils.withNewBodyElement { mountNode => + table.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Row 1
Row 2
0a
1b
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableGeneratorTests.scala b/facade/src/test/scala/react/semanticui/collections/table/TableGeneratorTests.scala deleted file mode 100644 index db9c6d0e..00000000 --- a/facade/src/test/scala/react/semanticui/collections/table/TableGeneratorTests.scala +++ /dev/null @@ -1,41 +0,0 @@ -package react.semanticui.collections.table - -import japgolly.scalajs.react.test._ -import utest._ - -object TableGeneratorTests extends TestSuite { - val tests = Tests { - test("TableGenerator headerRow") { - def makeRow(a: String, i: Int) = TableRow(TableCell(i.toString), TableCell(a)) - val headerRow = TableRow(TableHeaderCell("header 1"), TableHeaderCell("header 2")) - val footerRow = TableRow(TableCell("footer 1"), TableCell("footer 2")) - val table = - TableGenerator[String](tableData = Seq("a", "b"), - renderBodyRow = makeRow _, - headerRow = headerRow, - footerRow = footerRow - ) - ReactTestUtils.withNewBodyElement { mountNode => - table.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
header 1header 2
0a
1b
footer 1footer 2
""" - ) - } - } - test("TableGenerator headerRows") { - def makeRow(a: String, i: Int) = TableRow(TableCell(i.toString), TableCell(a)) - val headerRows = Seq(TableRow(TableHeaderCell("Row 1")), TableRow(TableHeaderCell("Row 2"))) - val table = - TableGenerator[String](tableData = Seq("a", "b"), - renderBodyRow = makeRow _, - headerRows = headerRows - ) - ReactTestUtils.withNewBodyElement { mountNode => - table.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Row 1
Row 2
0a
1b
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableHeaderCellSuite.scala b/facade/src/test/scala/react/semanticui/collections/table/TableHeaderCellSuite.scala new file mode 100644 index 00000000..13de60b3 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/table/TableHeaderCellSuite.scala @@ -0,0 +1,160 @@ +package react.semanticui.collections.table + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.elements.icon._ +import react.semanticui.verticalalignment +import react.semanticui.widths +import react.common.syntax.vdom._ + +class TableHeaderCellSuite extends munit.FunSuite { + test("default") { + val cell = TableHeaderCell(content = "Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("object apply") { + val cell = TableHeaderCell("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("active") { + val cell = TableHeaderCell(active = true, content = <.div("Some Content")) + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Some Content
""") + } + } + test("collapsing") { + val cell = TableHeaderCell(collapsing = true, content = "Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("disabled") { + val cell = TableHeaderCell(disabled = true)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("error") { + val cell = TableHeaderCell(error = true)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("icon") { + val cell = TableHeaderCell(icon = Icon("edit"), content = "Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """Some Content""" + ) + } + } + test("negative") { + val cell = TableHeaderCell(negative = true)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("positive") { + val cell = TableHeaderCell(positive = true)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("selectable") { + val cell = TableHeaderCell(selectable = true)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("singleLine") { + val cell = TableHeaderCell(singleLine = true)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("sorted ascending") { + val cell = TableHeaderCell(sorted = TableSorted.Ascending)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("sorted descending") { + val cell = TableHeaderCell(sorted = TableSorted.Descending)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("textAlign Center") { + val cell = TableHeaderCell(textAlign = TableTextAlign.Center)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("textAlign Right") { + val cell = TableHeaderCell(textAlign = TableTextAlign.Right)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("textAlign Left") { + val cell = TableHeaderCell(textAlign = TableTextAlign.Left)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("verticalAlign") { + val cell = TableHeaderCell(verticalAlign = verticalalignment.Top)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("aligned both") { + val cell = + TableHeaderCell(textAlign = TableTextAlign.Center, verticalAlign = verticalalignment.Middle)( + "Some Content" + ) + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """Some Content""" + ) + } + } + test("warning") { + val cell = TableHeaderCell(warning = true)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } + test("width") { + val cell = TableHeaderCell(width = widths.One)("Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + cell.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Some Content""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableHeaderCellTests.scala b/facade/src/test/scala/react/semanticui/collections/table/TableHeaderCellTests.scala deleted file mode 100644 index d390dea0..00000000 --- a/facade/src/test/scala/react/semanticui/collections/table/TableHeaderCellTests.scala +++ /dev/null @@ -1,162 +0,0 @@ -package react.semanticui.collections.table - -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.elements.icon._ -import react.semanticui.verticalalignment -import react.semanticui.widths -import utest._ - -object TableHeaderCellTests extends TestSuite { - val tests = Tests { - test("default") { - val cell = TableHeaderCell(content = "Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("object apply") { - val cell = TableHeaderCell("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("active") { - val cell = TableHeaderCell(active = true, content = <.div("Some Content")) - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Some Content
""") - } - } - test("collapsing") { - val cell = TableHeaderCell(collapsing = true, content = "Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("disabled") { - val cell = TableHeaderCell(disabled = true)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("error") { - val cell = TableHeaderCell(error = true)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("icon") { - val cell = TableHeaderCell(icon = Icon("edit"), content = "Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """Some Content""" - ) - } - } - test("negative") { - val cell = TableHeaderCell(negative = true)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("positive") { - val cell = TableHeaderCell(positive = true)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("selectable") { - val cell = TableHeaderCell(selectable = true)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("singleLine") { - val cell = TableHeaderCell(singleLine = true)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("sorted ascending") { - val cell = TableHeaderCell(sorted = TableSorted.Ascending)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("sorted descending") { - val cell = TableHeaderCell(sorted = TableSorted.Descending)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("textAlign Center") { - val cell = TableHeaderCell(textAlign = TableTextAlign.Center)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("textAlign Right") { - val cell = TableHeaderCell(textAlign = TableTextAlign.Right)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("textAlign Left") { - val cell = TableHeaderCell(textAlign = TableTextAlign.Left)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("verticalAlign") { - val cell = TableHeaderCell(verticalAlign = verticalalignment.Top)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("aligned both") { - val cell = - TableHeaderCell(textAlign = TableTextAlign.Center, - verticalAlign = verticalalignment.Middle - )( - "Some Content" - ) - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """Some Content""" - ) - } - } - test("warning") { - val cell = TableHeaderCell(warning = true)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - test("width") { - val cell = TableHeaderCell(width = widths.One)("Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - cell.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Some Content""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableHeaderSuite.scala b/facade/src/test/scala/react/semanticui/collections/table/TableHeaderSuite.scala new file mode 100644 index 00000000..1d7e884a --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/table/TableHeaderSuite.scala @@ -0,0 +1,31 @@ +package react.semanticui.collections.table + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class TableHeaderSuite extends munit.FunSuite { + test("TableHeader") { + val row1 = TableRow(TableHeaderCell("one")) + val row2 = TableRow(TableHeaderCell("two")) + val body = TableHeader(row1, row2) + ReactTestUtils.withNewBodyElement { mountNode => + body.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """onetwo""" + ) + } + } + test("fullWidth") { + val row1 = TableRow(TableHeaderCell("one")) + val row2 = TableRow(TableHeaderCell("two")) + val body = TableHeader(fullWidth = true)(row1, row2) + ReactTestUtils.withNewBodyElement { mountNode => + body.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """onetwo""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableHeaderTests.scala b/facade/src/test/scala/react/semanticui/collections/table/TableHeaderTests.scala deleted file mode 100644 index 26ec671a..00000000 --- a/facade/src/test/scala/react/semanticui/collections/table/TableHeaderTests.scala +++ /dev/null @@ -1,31 +0,0 @@ -package react.semanticui.collections.table - -import japgolly.scalajs.react.test._ -import utest._ - -object TableHeaderTests extends TestSuite { - val tests = Tests { - test("TableHeader") { - val row1 = TableRow(TableHeaderCell("one")) - val row2 = TableRow(TableHeaderCell("two")) - val body = TableHeader(row1, row2) - ReactTestUtils.withNewBodyElement { mountNode => - body.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """onetwo""" - ) - } - } - test("fullWidth") { - val row1 = TableRow(TableHeaderCell("one")) - val row2 = TableRow(TableHeaderCell("two")) - val body = TableHeader(fullWidth = true)(row1, row2) - ReactTestUtils.withNewBodyElement { mountNode => - body.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """onetwo""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableRowSuite.scala b/facade/src/test/scala/react/semanticui/collections/table/TableRowSuite.scala new file mode 100644 index 00000000..27ca0634 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/table/TableRowSuite.scala @@ -0,0 +1,179 @@ +package react.semanticui.collections.table + +import japgolly.scalajs.react.test._ +import react.semanticui.verticalalignment +import react.common.syntax.vdom._ + +class TableRowSuite extends munit.FunSuite { + test("No cells") { + val row = TableRow() + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } + test("One cell") { + val cell = TableCell(content = "Hi") + val row = TableRow(cell) + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """Hi""") + } + } + test("Two cells") { + val cell1 = TableCell(content = "High") + val cell2 = TableCell(content = "Low") + val row = TableRow(cell1, cell2) + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """HighLow""" + ) + } + } + test("Two header cells") { + val cell1 = TableHeaderCell(content = "High") + val cell2 = TableHeaderCell("Low") + val row = TableRow(cell1, cell2) + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """HighLow""" + ) + } + } + test("cells property TableCell") { + val cell1 = TableCell(content = "High") + val cell2 = TableCell(content = "Low") + val row = TableRow(cells = Seq(cell1, cell2)) + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """HighLow""" + ) + } + } + test("cells property TableHeaderCell") { + val cell1 = TableHeaderCell(content = "High") + val cell2 = TableHeaderCell(content = "Low") + val row = TableRow(cells = Seq(cell1, cell2)) + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """HighLow""" + ) + } + } + test("object apply") { + val cell1 = TableCell(content = "High") + val cell2 = TableCell(content = "Low") + val row = TableRow(cell1, cell2) + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """HighLow""" + ) + } + } + test("active") { + val cell1 = TableCell(content = "High") + val cell2 = TableCell(content = "Low") + val row = TableRow(active = true)(cell1, cell2) + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """HighLow""" + ) + } + } + test("disabled") { + val cell1 = TableCell(content = "High") + val cell2 = TableCell(content = "Low") + val row = TableRow(disabled = true)(cell1, cell2) + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """HighLow""" + ) + } + } + test("error") { + val cell1 = TableCell(content = "High") + val cell2 = TableCell(content = "Low") + val row = TableRow(error = true)(cell1, cell2) + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """HighLow""" + ) + } + } + test("negative") { + val cell1 = TableCell(content = "High") + val cell2 = TableCell(content = "Low") + val row = TableRow(negative = true)(cell1, cell2) + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """HighLow""" + ) + } + } + test("positive") { + val cell1 = TableCell(content = "High") + val cell2 = TableCell(content = "Low") + val row = TableRow(positive = true)(cell1, cell2) + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """HighLow""" + ) + } + } + test("textAlign") { + val cell1 = TableCell(content = "High") + val cell2 = TableCell(content = "Low") + val row = TableRow(textAlign = TableTextAlign.Right)(cell1, cell2) + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """HighLow""" + ) + } + } + test("verticalAlign") { + val cell1 = TableCell(content = "High") + val cell2 = TableCell(content = "Low") + val row = TableRow(verticalAlign = verticalalignment.Bottom)(cell1, cell2) + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """HighLow""" + ) + } + } + test("warning") { + val cell1 = TableCell(content = "High") + val cell2 = TableCell(content = "Low") + val row = TableRow(warning = true)(cell1, cell2) + ReactTestUtils.withNewBodyElement { mountNode => + row.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """HighLow""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableRowTests.scala b/facade/src/test/scala/react/semanticui/collections/table/TableRowTests.scala deleted file mode 100644 index 76755eca..00000000 --- a/facade/src/test/scala/react/semanticui/collections/table/TableRowTests.scala +++ /dev/null @@ -1,168 +0,0 @@ -package react.semanticui.collections.table - -import japgolly.scalajs.react.test._ -import react.semanticui.verticalalignment -import utest._ - -object TableRowTests extends TestSuite { - val tests = Tests { - test("No cells") { - val row = TableRow() - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - test("One cell") { - val cell = TableCell(content = "Hi") - val row = TableRow(cell) - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """Hi""") - } - } - test("Two cells") { - val cell1 = TableCell(content = "High") - val cell2 = TableCell(content = "Low") - val row = TableRow(cell1, cell2) - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """HighLow""" - ) - } - } - test("Two header cells") { - val cell1 = TableHeaderCell(content = "High") - val cell2 = TableHeaderCell("Low") - val row = TableRow(cell1, cell2) - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """HighLow""" - ) - } - } - test("cells property TableCell") { - val cell1 = TableCell(content = "High") - val cell2 = TableCell(content = "Low") - val row = TableRow(cells = Seq(cell1, cell2)) - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """HighLow""" - ) - } - } - test("cells property TableHeaderCell") { - val cell1 = TableHeaderCell(content = "High") - val cell2 = TableHeaderCell(content = "Low") - val row = TableRow(cells = Seq(cell1, cell2)) - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """HighLow""" - ) - } - } - test("object apply") { - val cell1 = TableCell(content = "High") - val cell2 = TableCell(content = "Low") - val row = TableRow(cell1, cell2) - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """HighLow""" - ) - } - } - test("active") { - val cell1 = TableCell(content = "High") - val cell2 = TableCell(content = "Low") - val row = TableRow(active = true)(cell1, cell2) - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """HighLow""" - ) - } - } - test("disabled") { - val cell1 = TableCell(content = "High") - val cell2 = TableCell(content = "Low") - val row = TableRow(disabled = true)(cell1, cell2) - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """HighLow""" - ) - } - } - test("error") { - val cell1 = TableCell(content = "High") - val cell2 = TableCell(content = "Low") - val row = TableRow(error = true)(cell1, cell2) - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """HighLow""" - ) - } - } - test("negative") { - val cell1 = TableCell(content = "High") - val cell2 = TableCell(content = "Low") - val row = TableRow(negative = true)(cell1, cell2) - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """HighLow""" - ) - } - } - test("positive") { - val cell1 = TableCell(content = "High") - val cell2 = TableCell(content = "Low") - val row = TableRow(positive = true)(cell1, cell2) - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """HighLow""" - ) - } - } - test("textAlign") { - val cell1 = TableCell(content = "High") - val cell2 = TableCell(content = "Low") - val row = TableRow(textAlign = TableTextAlign.Right)(cell1, cell2) - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """HighLow""" - ) - } - } - test("verticalAlign") { - val cell1 = TableCell(content = "High") - val cell2 = TableCell(content = "Low") - val row = TableRow(verticalAlign = verticalalignment.Bottom)(cell1, cell2) - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """HighLow""" - ) - } - } - test("warning") { - val cell1 = TableCell(content = "High") - val cell2 = TableCell(content = "Low") - val row = TableRow(warning = true)(cell1, cell2) - ReactTestUtils.withNewBodyElement { mountNode => - row.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """HighLow""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableSuite.scala b/facade/src/test/scala/react/semanticui/collections/table/TableSuite.scala new file mode 100644 index 00000000..aceaf60f --- /dev/null +++ b/facade/src/test/scala/react/semanticui/collections/table/TableSuite.scala @@ -0,0 +1,133 @@ +package react.semanticui.collections.table + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class TableSuite extends munit.FunSuite { + test("Table") { + val header = TableHeader(TableRow(TableHeaderCell("header"))) + val body = TableBody(TableRow(TableCell("A cell"))) + val footer = TableFooter(TableRow(TableCell("footer"))) + val table = Table(header, body, footer) + ReactTestUtils.withNewBodyElement { mountNode => + table.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
header
A cell
footer
""" + ) + } + } + test("TableAttached.Attached") { + val header = TableHeader(TableRow(TableHeaderCell("header"))) + val body = TableBody(TableRow(TableCell("A cell"))) + val footer = TableFooter(TableRow(TableCell("footer"))) + val table = Table(attached = TableAttached.Attached)(header, body, footer) + ReactTestUtils.withNewBodyElement { mountNode => + table.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
header
A cell
footer
""" + ) + } + } + test("TableAttached.NotAttached") { + val table = Table(attached = TableAttached.NotAttached) + ReactTestUtils.withNewBodyElement { mountNode => + table.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("TableAttached.Top") { + val table = Table(attached = TableAttached.Top) + ReactTestUtils.withNewBodyElement { mountNode => + table.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("TableAttached.Bottom") { + val table = Table(attached = TableAttached.Bottom) + ReactTestUtils.withNewBodyElement { mountNode => + table.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("TableBasic.Basic") { + val table = Table(basic = TableBasic.Basic) + ReactTestUtils.withNewBodyElement { mountNode => + table.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("TableBasic.VeryBasic") { + val table = Table(basic = TableBasic.Very) + ReactTestUtils.withNewBodyElement { mountNode => + table.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("TableBasic.NotBasic") { + val table = Table(basic = TableBasic.NotBasic) + ReactTestUtils.withNewBodyElement { mountNode => + table.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("Table celled") { + val table = Table(celled = true) + ReactTestUtils.withNewBodyElement { mountNode => + table.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("Table not celled") { + val table = Table(celled = false) + ReactTestUtils.withNewBodyElement { mountNode => + table.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("Table collapsing") { + val table = Table(collapsing = true) + ReactTestUtils.withNewBodyElement { mountNode => + table.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("Table not collapsing") { + val table = Table(collapsing = false) + ReactTestUtils.withNewBodyElement { mountNode => + table.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/collections/table/TableTests.scala b/facade/src/test/scala/react/semanticui/collections/table/TableTests.scala deleted file mode 100644 index e8b14389..00000000 --- a/facade/src/test/scala/react/semanticui/collections/table/TableTests.scala +++ /dev/null @@ -1,123 +0,0 @@ -package react.semanticui.collections.table - -import japgolly.scalajs.react.test._ -import utest._ - -object TableTests extends TestSuite { - val tests = Tests { - test("Table") { - val header = TableHeader(TableRow(TableHeaderCell("header"))) - val body = TableBody(TableRow(TableCell("A cell"))) - val footer = TableFooter(TableRow(TableCell("footer"))) - val table = Table(header, body, footer) - ReactTestUtils.withNewBodyElement { mountNode => - table.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
header
A cell
footer
""" - ) - } - } - test("TableAttached.Attached") { - val header = TableHeader(TableRow(TableHeaderCell("header"))) - val body = TableBody(TableRow(TableCell("A cell"))) - val footer = TableFooter(TableRow(TableCell("footer"))) - val table = Table(attached = TableAttached.Attached)(header, body, footer) - ReactTestUtils.withNewBodyElement { mountNode => - table.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
header
A cell
footer
""" - ) - } - } - test("TableAttached.NotAttached") { - val table = Table(attached = TableAttached.NotAttached) - ReactTestUtils.withNewBodyElement { mountNode => - table.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("TableAttached.Top") { - val table = Table(attached = TableAttached.Top) - ReactTestUtils.withNewBodyElement { mountNode => - table.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("TableAttached.Bottom") { - val table = Table(attached = TableAttached.Bottom) - ReactTestUtils.withNewBodyElement { mountNode => - table.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("TableBasic.Basic") { - val table = Table(basic = TableBasic.Basic) - ReactTestUtils.withNewBodyElement { mountNode => - table.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("TableBasic.VeryBasic") { - val table = Table(basic = TableBasic.Very) - ReactTestUtils.withNewBodyElement { mountNode => - table.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("TableBasic.NotBasic") { - val table = Table(basic = TableBasic.NotBasic) - ReactTestUtils.withNewBodyElement { mountNode => - table.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("Table celled") { - val table = Table(celled = true) - ReactTestUtils.withNewBodyElement { mountNode => - table.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("Table not celled") { - val table = Table(celled = false) - ReactTestUtils.withNewBodyElement { mountNode => - table.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("Table collapsing") { - val table = Table(collapsing = true) - ReactTestUtils.withNewBodyElement { mountNode => - table.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("Table not collapsing") { - val table = Table(collapsing = false) - ReactTestUtils.withNewBodyElement { mountNode => - table.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/button/ButtonContentSuite.scala b/facade/src/test/scala/react/semanticui/elements/button/ButtonContentSuite.scala new file mode 100644 index 00000000..15e95399 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/button/ButtonContentSuite.scala @@ -0,0 +1,29 @@ +package react.semanticui.elements.button + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ButtonContentSuite extends munit.FunSuite { + test("render") { + val buttonContent = ButtonContent("abc") + ReactTestUtils.withNewBodyElement { mountNode => + buttonContent.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
abc
""") + } + } + test("contentString") { + val buttonContent = ButtonContent(content = "abc") + ReactTestUtils.withNewBodyElement { mountNode => + buttonContent.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
abc
""") + } + } + test("contentNode") { + val buttonContent = ButtonContent(content = <.span("abc")) + ReactTestUtils.withNewBodyElement { mountNode => + buttonContent.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/button/ButtonContentTests.scala b/facade/src/test/scala/react/semanticui/elements/button/ButtonContentTests.scala deleted file mode 100644 index 0d4fbd26..00000000 --- a/facade/src/test/scala/react/semanticui/elements/button/ButtonContentTests.scala +++ /dev/null @@ -1,31 +0,0 @@ -package react.semanticui.elements.button - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ButtonContentTests extends TestSuite { - val tests = Tests { - test("render") { - val buttonContent = ButtonContent("abc") - ReactTestUtils.withNewBodyElement { mountNode => - buttonContent.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
abc
""") - } - } - test("contentString") { - val buttonContent = ButtonContent(content = "abc") - ReactTestUtils.withNewBodyElement { mountNode => - buttonContent.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
abc
""") - } - } - test("contentNode") { - val buttonContent = ButtonContent(content = <.span("abc")) - ReactTestUtils.withNewBodyElement { mountNode => - buttonContent.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/button/ButtonGroupTests.scala b/facade/src/test/scala/react/semanticui/elements/button/ButtonGroupTests.scala index 56129962..8956c166 100644 --- a/facade/src/test/scala/react/semanticui/elements/button/ButtonGroupTests.scala +++ b/facade/src/test/scala/react/semanticui/elements/button/ButtonGroupTests.scala @@ -1,38 +1,38 @@ package react.semanticui.elements.button -import utest._ import japgolly.scalajs.react.test._ import japgolly.scalajs.react.vdom.html_<^._ import react.semanticui.widths.widthOf +import react.common.syntax.vdom._ -object ButtonGroupTests extends TestSuite { - val tests = Tests { - test("render") { - val buttonGroup = ButtonGroup("abc") - ReactTestUtils.withNewBodyElement { mountNode => - buttonGroup.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
abc
""") - } +class ButtonGroupTests extends munit.FunSuite { + test("render") { + val buttonGroup = ButtonGroup("abc") + ReactTestUtils.withNewBodyElement { mountNode => + buttonGroup.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
abc
""") } - test("widths") { - val buttonGroup = - ButtonGroup(widths = widthOf(2))(Button("1"), Button("2")) - ReactTestUtils.withNewBodyElement { mountNode => - buttonGroup.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } + } + test("widths") { + val buttonGroup = + ButtonGroup(widths = widthOf(2))(Button("1"), Button("2")) + ReactTestUtils.withNewBodyElement { mountNode => + buttonGroup.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) } - test("buttons") { - val buttonGroup = - ButtonGroup()(Button("1"), Button("2")) - ReactTestUtils.withNewBodyElement { mountNode => - buttonGroup.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } + } + test("buttons") { + val buttonGroup = + ButtonGroup()(Button("1"), Button("2")) + ReactTestUtils.withNewBodyElement { mountNode => + buttonGroup.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) } } } diff --git a/facade/src/test/scala/react/semanticui/elements/button/ButtonOrTests.scala b/facade/src/test/scala/react/semanticui/elements/button/ButtonOrTests.scala index cb7abcdc..84ed6a78 100644 --- a/facade/src/test/scala/react/semanticui/elements/button/ButtonOrTests.scala +++ b/facade/src/test/scala/react/semanticui/elements/button/ButtonOrTests.scala @@ -1,16 +1,14 @@ package react.semanticui.elements.button -import utest._ import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ -object ButtonOrTests extends TestSuite { - val tests = Tests { - test("render") { - val buttonOr = ButtonOr() - ReactTestUtils.withNewBodyElement { mountNode => - buttonOr.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } +class ButtonOrTests extends munit.FunSuite { + test("render") { + val buttonOr = ButtonOr() + ReactTestUtils.withNewBodyElement { mountNode => + buttonOr.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") } } } diff --git a/facade/src/test/scala/react/semanticui/elements/button/ButtonTests.scala b/facade/src/test/scala/react/semanticui/elements/button/ButtonTests.scala index c009c5d6..eb5d9c0f 100644 --- a/facade/src/test/scala/react/semanticui/elements/button/ButtonTests.scala +++ b/facade/src/test/scala/react/semanticui/elements/button/ButtonTests.scala @@ -1,6 +1,5 @@ package react.semanticui.elements.button -import utest._ import japgolly.scalajs.react.test._ import japgolly.scalajs.react.vdom.html_<^._ import react.semanticui.elements.icon._ @@ -10,186 +9,237 @@ import react.semanticui.colors._ import react.semanticui.sizes._ import react.semanticui.floats._ import react.semanticui._ +import react.common.syntax.vdom._ -object ButtonTests extends TestSuite { - val tests = Tests { - test("render") { - val button = Button() - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert(m.outerHtmlScrubbed() == """""") - } - } - test("renderAs") { - val button = Button(as = "a") - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert(m.outerHtmlScrubbed() == """""") - } - } - test("renderAsTag") { - val button = Button(as = <.a(^.href := "")(^.target := "")) - ReactTestUtils.withRenderedIntoDocument(button) { m => - val html = m.outerHtmlScrubbed() - assert(html == """""") - } - } - test("renderAsForm") { - val button = Button(as = As.Form(Form(error = true))) - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert( - m.outerHtmlScrubbed() == """
""" - ) - } - } - test("renderAsFormWithPassthrough") { - val button = Button(as = As.Form(Form(error = true)(^.method := "post"))) - ReactTestUtils.withRenderedIntoDocument(button) { m => - val html = m.outerHtmlScrubbed() - assert( - html == """
""" - ) - } - } - test("attached") { - val button = Button(attached = ButtonAttached.Top) - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert( - m.outerHtmlScrubbed() == """
""" - ) - } - } - test("color") { - val button = Button(color = Blue) - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert(m.outerHtmlScrubbed() == """""") - } - } - test("active") { - val button = Button(active = true) - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert(m.outerHtmlScrubbed() == """""") - } - } - test("icon") { - val button = Button(icon = true)(Icon(name = "comment")) - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert( - m.outerHtmlScrubbed() == """""" - ) - } - } - test("iconShorthand") { - val button = Button(icon = Icon(name = "comment")) - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert( - m.outerHtmlScrubbed() == """""" - ) - } - } - test("label") { - val button = Button(label = Label("Label")) - ReactTestUtils.withRenderedIntoDocument(button) { m => - val html = m.outerHtmlScrubbed() - assert( - html == """
Label
""" - ) - } - } - test("labelText") { - val button = Button(label = "Label") - ReactTestUtils.withRenderedIntoDocument(button) { m => - val html = m.outerHtmlScrubbed() - assert( - html == """
Label
""" - ) - } - } - test("iconAndText") { - val button = Button()(Icon(name = "comment"), "23") - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert( - m.outerHtmlScrubbed() == """""" - ) - } - } - test("toggle") { - val button = Button(toggle = true) - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert( - m.outerHtmlScrubbed() == """""" - ) - } - } - test("tabIndex") { - val button = Button(tabIndex = 2) - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert(m.outerHtmlScrubbed() == """""") - } - } - test("floated") { - val button = Button(floated = Right) - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert(m.outerHtmlScrubbed() == """""") - } - } - test("circular") { - val button = Button(circular = true) - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert(m.outerHtmlScrubbed() == """""") - } - } - test("secondary") { - val button = Button(secondary = true, circular = true) - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert( - m.outerHtmlScrubbed() == """""" - ) - } - } - test("basic") { - val button = Button(basic = true) - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert(m.outerHtmlScrubbed() == """""") - } - } - test("className") { - val button = Button(className = "extra") - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert(m.outerHtmlScrubbed() == """""") - } - } - test("size") { - val button = Button(size = Big) - ReactTestUtils.withRenderedIntoDocument(button) { m => - assert(m.outerHtmlScrubbed() == """""") - } - } - test("withContent") { - val button = Button(^.tpe := "submit") - ReactTestUtils.withRenderedIntoDocument(button) { m => - val html = m.outerHtmlScrubbed() - assert(html == """""") - } - } - test("withTwoContents") { - val button = Button(^.tpe := "button")("Submit") - ReactTestUtils.withRenderedIntoDocument(button) { m => - val html = m.outerHtmlScrubbed() - assert(html == """""") - } - } - test("withMixedContent") { - val button = Button(^.tpe := "button", "Submit") - ReactTestUtils.withRenderedIntoDocument(button) { m => - val html = m.outerHtmlScrubbed() - assert(html == """""") - } - } - test("withPropsAndContent") { - val button = Button(color = Blue)(^.tpe := "submit") - ReactTestUtils.withRenderedIntoDocument(button) { m => - val html = m.outerHtmlScrubbed() - assert(html == """""") - } +class ButtonTests extends munit.FunSuite { + test("render") { + val button = Button() + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("renderAs") { + val button = Button(as = "a") + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("renderAsTag") { + val button = Button(as = <.a(^.href := "")(^.target := "")) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("renderAsForm") { + val button = Button(as = As.Form(Form(error = true))) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
""" + ) + } + } + test("renderAsFormWithPassthrough") { + val button = Button(as = As.Form(Form(error = true)(^.method := "post"))) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
""" + ) + } + } + test("attached") { + val button = Button(attached = ButtonAttached.Top) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
""" + ) + } + } + test("color") { + val button = Button(color = Blue) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("active") { + val button = Button(active = true) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("icon") { + val button = Button(icon = true)(Icon(name = "comment")) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """""" + ) + } + } + test("iconShorthand") { + val button = Button(icon = Icon(name = "comment")) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """""" + ) + } + } + test("label") { + val button = Button(label = Label("Label")) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
Label
""" + ) + } + } + test("labelText") { + val button = Button(label = "Label") + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
Label
""" + ) + } + } + test("iconAndText") { + val button = Button()(Icon(name = "comment"), "23") + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """""" + ) + } + } + test("toggle") { + val button = Button(toggle = true) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """""" + ) + } + } + test("tabIndex") { + val button = Button(tabIndex = 2) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("floated") { + val button = Button(floated = Right) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("circular") { + val button = Button(circular = true) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("secondary") { + val button = Button(secondary = true, circular = true) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """""" + ) + } + } + test("basic") { + val button = Button(basic = true) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("className") { + val button = Button(className = "extra") + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("size") { + val button = Button(size = Big) + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("withContent") { + val button = Button(^.tpe := "submit") + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("withTwoContents") { + val button = Button(^.tpe := "button")("Submit") + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("withMixedContent") { + val button = Button(^.tpe := "button", "Submit") + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("withPropsAndContent") { + val button = Button(color = Blue)(^.tpe := "submit") + ReactTestUtils.withNewBodyElement { mountNode => + button.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") } } } diff --git a/facade/src/test/scala/react/semanticui/elements/container/ContainerSuite.scala b/facade/src/test/scala/react/semanticui/elements/container/ContainerSuite.scala new file mode 100644 index 00000000..558ec58e --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/container/ContainerSuite.scala @@ -0,0 +1,38 @@ +package react.semanticui.elements.container + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ContainerSuite extends munit.FunSuite { + test("render") { + val container = Container() + ReactTestUtils.withNewBodyElement { mountNode => + container.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderWithChildren") { + val container = Container("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + container.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } + test("renderWithPropsAndChildren") { + val container = Container(fluid = true)("Abc", <.div("test")) + ReactTestUtils.withNewBodyElement { mountNode => + container.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, + """
Abc
test
""" + ) + } + } + test("renderAs") { + val container = Container(as = <.a, fluid = true)("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + container.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/container/ContainerTests.scala b/facade/src/test/scala/react/semanticui/elements/container/ContainerTests.scala deleted file mode 100644 index 554ed3d7..00000000 --- a/facade/src/test/scala/react/semanticui/elements/container/ContainerTests.scala +++ /dev/null @@ -1,40 +0,0 @@ -package react.semanticui.elements.container - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ContainerTests extends TestSuite { - val tests = Tests { - test("render") { - val container = Container() - ReactTestUtils.withNewBodyElement { mountNode => - container.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderWithChildren") { - val container = Container("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - container.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - test("renderWithPropsAndChildren") { - val container = Container(fluid = true)("Abc", <.div("test")) - ReactTestUtils.withNewBodyElement { mountNode => - container.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Abc
test
""" - ) - } - } - test("renderAs") { - val container = Container(as = <.a, fluid = true)("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - container.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/divider/DividerSuite.scala b/facade/src/test/scala/react/semanticui/elements/divider/DividerSuite.scala new file mode 100644 index 00000000..e86747c0 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/divider/DividerSuite.scala @@ -0,0 +1,33 @@ +package react.semanticui.elements.divider + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.elements.image.Image +import react.common.syntax.vdom._ + +class DividerSuite extends munit.FunSuite { + test("render") { + val divider = Divider() + ReactTestUtils.withNewBodyElement { mountNode => + divider.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderAs") { + val divider = Divider(as = <.a) + ReactTestUtils.withNewBodyElement { mountNode => + divider.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } + test("children") { + val divider = Divider(vertical = true)(<.div("abc"), Image(href = "cde")) + ReactTestUtils.withNewBodyElement { mountNode => + divider.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
abc
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/divider/DividerTests.scala b/facade/src/test/scala/react/semanticui/elements/divider/DividerTests.scala deleted file mode 100644 index 29a086ae..00000000 --- a/facade/src/test/scala/react/semanticui/elements/divider/DividerTests.scala +++ /dev/null @@ -1,34 +0,0 @@ -package react.semanticui.elements.divider - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.elements.image.Image - -object DividerTests extends TestSuite { - val tests = Tests { - test("render") { - val divider = Divider() - ReactTestUtils.withNewBodyElement { mountNode => - divider.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderAs") { - val divider = Divider(as = <.a) - ReactTestUtils.withNewBodyElement { mountNode => - divider.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - test("children") { - val divider = Divider(vertical = true)(<.div("abc"), Image(href = "cde")) - ReactTestUtils.withNewBodyElement { mountNode => - divider.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
abc
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/flag/FlagTests.scala b/facade/src/test/scala/react/semanticui/elements/flag/FlagTests.scala index 3bfbbd79..ad21cdd2 100644 --- a/facade/src/test/scala/react/semanticui/elements/flag/FlagTests.scala +++ b/facade/src/test/scala/react/semanticui/elements/flag/FlagTests.scala @@ -1,24 +1,22 @@ package react.semanticui.elements.flag -import utest._ import japgolly.scalajs.react.test._ import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ -object FlagTests extends TestSuite { - val tests = Tests { - test("render") { - val menuItem = Flag(name = "cl") - ReactTestUtils.withNewBodyElement { mountNode => - menuItem.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } +class FlagSuite extends munit.FunSuite { + test("render") { + val menuItem = Flag(name = "cl") + ReactTestUtils.withNewBodyElement { mountNode => + menuItem.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") } - test("renderAs") { - val menuItem = Flag(as = <.a, name = "cl") - ReactTestUtils.withNewBodyElement { mountNode => - menuItem.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } + } + test("renderAs") { + val menuItem = Flag(as = <.a, name = "cl") + ReactTestUtils.withNewBodyElement { mountNode => + menuItem.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") } } } diff --git a/facade/src/test/scala/react/semanticui/elements/header/HeaderContentSuite.scala b/facade/src/test/scala/react/semanticui/elements/header/HeaderContentSuite.scala new file mode 100644 index 00000000..2e346dd3 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/header/HeaderContentSuite.scala @@ -0,0 +1,22 @@ +package react.semanticui.elements.header + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class HeaderContentSuite extends munit.FunSuite { + test("render") { + val header = HeaderContent() + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderAs") { + val header = HeaderContent(as = <.a) + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/header/HeaderContentTests.scala b/facade/src/test/scala/react/semanticui/elements/header/HeaderContentTests.scala deleted file mode 100644 index 2aa9d5ca..00000000 --- a/facade/src/test/scala/react/semanticui/elements/header/HeaderContentTests.scala +++ /dev/null @@ -1,24 +0,0 @@ -package react.semanticui.elements.header - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object HeaderContentTests extends TestSuite { - val tests = Tests { - test("render") { - val header = HeaderContent() - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderAs") { - val header = HeaderContent(as = <.a) - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/header/HeaderSubheaderSuite.scala b/facade/src/test/scala/react/semanticui/elements/header/HeaderSubheaderSuite.scala new file mode 100644 index 00000000..11c76168 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/header/HeaderSubheaderSuite.scala @@ -0,0 +1,22 @@ +package react.semanticui.elements.header + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class HeaderSubheaderSuite extends munit.FunSuite { + test("render") { + val header = HeaderSubheader() + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderAs") { + val header = HeaderSubheader(as = <.a) + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/header/HeaderSubheaderTests.scala b/facade/src/test/scala/react/semanticui/elements/header/HeaderSubheaderTests.scala deleted file mode 100644 index 201081dd..00000000 --- a/facade/src/test/scala/react/semanticui/elements/header/HeaderSubheaderTests.scala +++ /dev/null @@ -1,24 +0,0 @@ -package react.semanticui.elements.header - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object HeaderSubheaderTests extends TestSuite { - val tests = Tests { - test("render") { - val header = HeaderSubheader() - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderAs") { - val header = HeaderSubheader(as = <.a) - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/header/HeaderSuite.scala b/facade/src/test/scala/react/semanticui/elements/header/HeaderSuite.scala new file mode 100644 index 00000000..91c3ab48 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/header/HeaderSuite.scala @@ -0,0 +1,33 @@ +package react.semanticui.elements.header + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class HeaderSuite extends munit.FunSuite { + test("render") { + val header = Header() + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderAs") { + val header = Header(as = <.a) + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } + test("subheader") { + val header = + Header(subheader = HeaderSubheader("abc")) + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
abc
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/header/HeaderTests.scala b/facade/src/test/scala/react/semanticui/elements/header/HeaderTests.scala deleted file mode 100644 index 9880e7d2..00000000 --- a/facade/src/test/scala/react/semanticui/elements/header/HeaderTests.scala +++ /dev/null @@ -1,34 +0,0 @@ -package react.semanticui.elements.header - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object HeaderTests extends TestSuite { - val tests = Tests { - test("render") { - val header = Header() - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderAs") { - val header = Header(as = <.a) - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - test("subheader") { - val header = - Header(subheader = HeaderSubheader("abc")) - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
abc
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/icon/IconSuite.scala b/facade/src/test/scala/react/semanticui/elements/icon/IconSuite.scala new file mode 100644 index 00000000..e114074a --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/icon/IconSuite.scala @@ -0,0 +1,109 @@ +package react.semanticui.elements.icon + +import japgolly.scalajs.react.test._ +import react.common._ +import react.semanticui.elements.icon.IconRotated._ +import react.semanticui.sizes._ +import react.semanticui.colors._ +import react.common.syntax.vdom._ + +class IconSuite extends munit.FunSuite { + test("render") { + val icon = Icon(name = "edit") + ReactTestUtils.withNewBodyElement { mountNode => + icon.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } + test("renderFitted") { + val icon = Icon(fitted = true, name = "edit") + ReactTestUtils.withNewBodyElement { mountNode => + icon.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } + test("renderClassName") { + val icon = Icon(className = "another", name = "edit") + ReactTestUtils.withNewBodyElement { mountNode => + icon.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } + test("size") { + val icon = Icon(size = Big, name = "edit") + ReactTestUtils.withNewBodyElement { mountNode => + icon.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } + test("flipped") { + val icon = Icon(flipped = IconFlip.Horizontally, name = "edit") + ReactTestUtils.withNewBodyElement { mountNode => + icon.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } + test("color") { + val icon = Icon(color = Blue, name = "edit") + ReactTestUtils.withNewBodyElement { mountNode => + icon.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } + test("colorCopy") { + val icon = Icon(color = Blue, name = "edit").color(Red) + ReactTestUtils.withNewBodyElement { mountNode => + icon.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } + test("rotated") { + val icon = Icon(rotated = IconRotated.Clockwise, name = "edit") + ReactTestUtils.withNewBodyElement { mountNode => + icon.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } + test("group") { + val icon = IconGroup(Icon(rotated = Clockwise, name = "edit"), Icon(name = "copy")) + ReactTestUtils.withNewBodyElement { mountNode => + icon.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } + test("conversions") { + assert(Icon(loading = true, name = "edit") == Icon("edit").loading()) + assert(Icon(loading = false, name = "edit") == Icon("edit").loading(false)) + assert(Icon(color = Red, name = "edit") == Icon("edit").color(Red)) + assert( + Icon(rotated = IconRotated.Clockwise, name = "edit") == Icon("edit") + .rotated(IconRotated.Clockwise) + ) + val clazz = Css("prop") + assertEquals(Icon(clazz = clazz, name = "edit"), Icon("edit").clazz(clazz)) + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/icon/IconTests.scala b/facade/src/test/scala/react/semanticui/elements/icon/IconTests.scala deleted file mode 100644 index 4d75eaea..00000000 --- a/facade/src/test/scala/react/semanticui/elements/icon/IconTests.scala +++ /dev/null @@ -1,103 +0,0 @@ -package react.semanticui.elements.icon - -import utest._ -import japgolly.scalajs.react.test._ -import react.common._ -import react.semanticui.elements.icon.IconRotated._ -import react.semanticui.sizes._ -import react.semanticui.colors._ - -object IconTests extends TestSuite { - val tests = Tests { - test("render") { - val icon = Icon(name = "edit") - ReactTestUtils.withNewBodyElement { mountNode => - icon.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - test("renderFitted") { - val icon = Icon(fitted = true, name = "edit") - ReactTestUtils.withNewBodyElement { mountNode => - icon.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } - } - test("renderClassName") { - val icon = Icon(className = "another", name = "edit") - ReactTestUtils.withNewBodyElement { mountNode => - icon.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } - } - test("size") { - val icon = Icon(size = Big, name = "edit") - ReactTestUtils.withNewBodyElement { mountNode => - icon.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } - } - test("flipped") { - val icon = Icon(flipped = IconFlip.Horizontally, name = "edit") - ReactTestUtils.withNewBodyElement { mountNode => - icon.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } - } - test("color") { - val icon = Icon(color = Blue, name = "edit") - ReactTestUtils.withNewBodyElement { mountNode => - icon.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } - } - test("colorCopy") { - val icon = Icon(color = Blue, name = "edit").color(Red) - ReactTestUtils.withNewBodyElement { mountNode => - icon.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } - } - test("rotated") { - val icon = Icon(rotated = IconRotated.Clockwise, name = "edit") - ReactTestUtils.withNewBodyElement { mountNode => - icon.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } - } - test("group") { - val icon = IconGroup(Icon(rotated = Clockwise, name = "edit"), Icon(name = "copy")) - ReactTestUtils.withNewBodyElement { mountNode => - icon.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } - } - test("conversions") { - assert(Icon(loading = true, name = "edit") == Icon("edit").loading()) - assert(Icon(loading = false, name = "edit") == Icon("edit").loading(false)) - assert(Icon(color = Red, name = "edit") == Icon("edit").color(Red)) - assert( - Icon(rotated = IconRotated.Clockwise, name = "edit") == Icon("edit") - .rotated(IconRotated.Clockwise) - ) - val clazz = Css("prop") - assert(Icon(clazz = clazz, name = "edit") == Icon("edit").clazz(clazz)) - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/image/ImageSuite.scala b/facade/src/test/scala/react/semanticui/elements/image/ImageSuite.scala new file mode 100644 index 00000000..d512c92b --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/image/ImageSuite.scala @@ -0,0 +1,45 @@ +package react.semanticui.elements.image + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.elements.icon._ +import react.common.syntax.vdom._ + +class ImageSuite extends munit.FunSuite { + test("render") { + val image = Image() + ReactTestUtils.withNewBodyElement { mountNode => + image.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } + test("renderInside") { + val image = <.div( + Image(src = "http://fig1.jpg", className = "draggable") + ) + ReactTestUtils.withNewBodyElement { mountNode => + image.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("renderAs") { + val image = Image(as = "a", href = "abc") + ReactTestUtils.withNewBodyElement { mountNode => + image.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } + test("renderChild") { + val image = Image(as = <.a, circular = true)(Icon(name = "help")) + ReactTestUtils.withNewBodyElement { mountNode => + image.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/image/ImageTests.scala b/facade/src/test/scala/react/semanticui/elements/image/ImageTests.scala deleted file mode 100644 index a28cf3bf..00000000 --- a/facade/src/test/scala/react/semanticui/elements/image/ImageTests.scala +++ /dev/null @@ -1,45 +0,0 @@ -package react.semanticui.elements.image - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.elements.icon._ - -object ImageTests extends TestSuite { - val tests = Tests { - test("render") { - val image = Image() - ReactTestUtils.withNewBodyElement { mountNode => - image.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - test("renderInside") { - val image = <.div( - Image(src = "http://fig1.jpg", className = "draggable") - ) - ReactTestUtils.withNewBodyElement { mountNode => - image.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("renderAs") { - val image = Image(as = "a", href = "abc") - ReactTestUtils.withNewBodyElement { mountNode => - image.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - test("renderChild") { - val image = Image(as = <.a, circular = true)(Icon(name = "help")) - ReactTestUtils.withNewBodyElement { mountNode => - image.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/input/InputSuite.scala b/facade/src/test/scala/react/semanticui/elements/input/InputSuite.scala new file mode 100644 index 00000000..7d29e817 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/input/InputSuite.scala @@ -0,0 +1,81 @@ +package react.semanticui.elements.input + +import japgolly.scalajs.react.test.ReactTestUtils +import japgolly.scalajs.react.Callback +import react.semanticui.elements.icon._ +import react.common.syntax.vdom._ +import japgolly.scalajs.react.vdom.VdomNode + +class InputSuite extends munit.FunSuite { + test("render") { + val input = Input() + ReactTestUtils.withNewBodyElement { mountNode => + input.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("actionBool") { + val input = Input(action = true) + ReactTestUtils.withNewBodyElement { mountNode => + input.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("actionItem") { + val input = Input(action = Icon(name = "comment"): VdomNode) + ReactTestUtils.withNewBodyElement { mountNode => + input.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("icon") { + val input = Input(icon = Icon(name = "comment")) + ReactTestUtils.withNewBodyElement { mountNode => + input.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("value") { + val input = Input(value = "test") + ReactTestUtils.withNewBodyElement { mountNode => + input.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("input") { + val input = Input(input = Icon(name = "comment"): VdomNode) + ReactTestUtils.withNewBodyElement { mountNode => + input.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("typePassword") { + val input = Input(tpe = "password") + ReactTestUtils.withNewBodyElement { mountNode => + input.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("onChange") { + val input = Input(onChange = Callback.log("abc")) + ReactTestUtils.withNewBodyElement { mountNode => + input.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/input/InputTests.scala b/facade/src/test/scala/react/semanticui/elements/input/InputTests.scala deleted file mode 100644 index 1ca54f9d..00000000 --- a/facade/src/test/scala/react/semanticui/elements/input/InputTests.scala +++ /dev/null @@ -1,79 +0,0 @@ -package react.semanticui.elements.input - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.test.ReactTestUtils -import japgolly.scalajs.react.vdom.html_<^._ -import japgolly.scalajs.react.Callback -import react.semanticui.elements.icon._ - -object InputTests extends TestSuite { - val tests = Tests { - test("render") { - val input = Input() - ReactTestUtils.withRenderedIntoDocument(input) { m => - assert(m.outerHtmlScrubbed() == """
""") - } - } - test("actionBool") { - val input = Input(action = true) - ReactTestUtils.withRenderedIntoDocument(input) { m => - assert( - m.outerHtmlScrubbed() == """
""" - ) - } - } - test("actionItem") { - val input = Input(action = Icon(name = "comment").vdomElement) - ReactTestUtils.withRenderedIntoDocument(input) { m => - assert( - m.outerHtmlScrubbed() == """
""" - ) - } - } - test("icon") { - val input = Input(icon = Icon(name = "comment")) - ReactTestUtils.withRenderedIntoDocument(input) { m => - assert( - m.outerHtmlScrubbed() == """
""" - ) - } - } - test("value") { - val input = Input(value = "test") - ReactTestUtils.withRenderedIntoDocument(input) { m => - assert( - m.outerHtmlScrubbed() == """
""" - ) - } - } - test("iconAndText") { - val input = Input()(Icon(name = "comment"), "23") - ReactTestUtils.withRenderedIntoDocument(input) { m => - assert( - m.outerHtmlScrubbed() == """
23
""" - ) - } - } - test("input") { - val input = Input(input = Icon(name = "comment").vdomElement) - ReactTestUtils.withRenderedIntoDocument(input) { m => - assert( - m.outerHtmlScrubbed() == """
""" - ) - } - } - test("typePassword") { - val input = Input(tpe = "password") - ReactTestUtils.withRenderedIntoDocument(input) { m => - assert(m.outerHtmlScrubbed() == """
""") - } - } - test("onChange") { - val input = Input(onChange = Callback.log("abc")) - ReactTestUtils.withRenderedIntoDocument(input) { m => - assert(m.outerHtmlScrubbed() == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/label/LabelGroup.scala b/facade/src/test/scala/react/semanticui/elements/label/LabelGroupSuite.scala similarity index 95% rename from facade/src/test/scala/react/semanticui/elements/label/LabelGroup.scala rename to facade/src/test/scala/react/semanticui/elements/label/LabelGroupSuite.scala index 2a41ba85..d38f95dc 100644 --- a/facade/src/test/scala/react/semanticui/elements/label/LabelGroup.scala +++ b/facade/src/test/scala/react/semanticui/elements/label/LabelGroupSuite.scala @@ -2,6 +2,7 @@ package react.semanticui.elements.label import munit._ import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ class LabelGroupSuite extends FunSuite { test("render") { diff --git a/facade/src/test/scala/react/semanticui/elements/label/LabelSuite.scala b/facade/src/test/scala/react/semanticui/elements/label/LabelSuite.scala new file mode 100644 index 00000000..516efda2 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/label/LabelSuite.scala @@ -0,0 +1,208 @@ +package react.semanticui.elements.label + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.elements.icon._ +import react.semanticui.colors._ +import react.semanticui.sizes._ +import react.common.syntax.vdom._ + +class LabelSuite extends munit.FunSuite { + test("render") { + val label = Label() + ReactTestUtils.withNewBodyElement { mountNode => + label.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("attached") { + val label = Label(attached = LabelAttached.Top) + ReactTestUtils.withNewBodyElement { mountNode => + label.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("color") { + val label = Label(color = Blue) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("corner_boolean") { + val label = Label(corner = LabelCorner.Corner) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("corner_string") { + val label = Label(corner = LabelCorner.Left) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("prompt") { + val label = Label(prompt = true) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("detailVdom") { + val labelDetail = LabelDetail("Detail") + val label = Label(detail = labelDetail) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
Detail
""") + } + } + test("active") { + val label = Label(active = true) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("icon") { + val label = Label(Icon(name = "comment")) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals( + m.innerHTML, + """
""" + ) + } + } + test("iconShorthand") { + val label = Label(icon = Icon(name = "comment")) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals( + m.innerHTML, + """
""" + ) + } + } + test("iconAndText") { + val label = Label(Icon("comment"), "23") + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + val html = m.innerHTML + assertEquals( + html, + """
23
""" + ) + } + } + test("iconAndTextShorthand") { + val label = Label(icon = Icon(name = "comment"), content = "23") + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + val html = m.innerHTML + assertEquals( + html, + """
23
""" + ) + } + } + test("imageAndDetail") { + val label = Label(as = "a", image = true)(<.img(^.src := "image.jpg"), "img") + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """img""") + } + } + test("tag") { + val label = Label(tag = true) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("horizontal") { + val label = Label(horizontal = true) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("floating") { + val label = Label(floating = true) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("circular") { + val label = Label(circular = true) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("empty") { + val label = Label(empty = true, circular = true) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("pointing") { + val label = Label(pointing = LabelPointing.Default) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("pointingBelow") { + val label = Label(pointing = LabelPointing.Below) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("basic") { + val label = Label(basic = true) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("className") { + val label = Label(className = "extra") + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("removeIcon") { + val label = Label(removeIcon = Icon(name = "remove")) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("ribbonDefault") { + val label = Label(ribbon = LabelRibbon.Default) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("ribbonRight") { + val label = Label(ribbon = LabelRibbon.Right) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } + test("size") { + val label = Label(size = Big) + ReactTestUtils.withNewBodyElement { m => + label.renderIntoDOM(m) + assertEquals(m.innerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/label/LabelTests.scala b/facade/src/test/scala/react/semanticui/elements/label/LabelTests.scala deleted file mode 100644 index fc85d630..00000000 --- a/facade/src/test/scala/react/semanticui/elements/label/LabelTests.scala +++ /dev/null @@ -1,209 +0,0 @@ -package react.semanticui.elements.label - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.elements.icon._ -import react.semanticui.colors._ -import react.semanticui.sizes._ - -object LabelTests extends TestSuite { - val tests = Tests { - test("render") { - val label = Label() - ReactTestUtils.withRenderedIntoDocument(label) { m => - assert(m.outerHtmlScrubbed() == """
""") - } - } - test("attached") { - val label = Label(attached = LabelAttached.Top) - ReactTestUtils.withNewBodyElement { mountNode => - label.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("color") { - val label = Label(color = Blue) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("corner_boolean") { - val label = Label(corner = LabelCorner.Corner) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("corner_string") { - val label = Label(corner = LabelCorner.Left) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("prompt") { - val label = Label(prompt = true) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("detailVdom") { - val labelDetail = LabelDetail("Detail") - val label = Label(detail = labelDetail) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert( - m.innerHTML == """
Detail
""" - ) - } - } - test("active") { - val label = Label(active = true) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("icon") { - val label = Label(Icon(name = "comment")) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert( - m.innerHTML == """
""" - ) - } - } - test("iconShorthand") { - val label = Label(icon = Icon(name = "comment")) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert( - m.innerHTML == """
""" - ) - } - } - test("iconAndText") { - val label = Label(Icon("comment"), "23") - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - val html = m.innerHTML - assert( - html == """
23
""" - ) - } - } - test("iconAndTextShorthand") { - val label = Label(icon = Icon(name = "comment"), content = "23") - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - val html = m.innerHTML - assert( - html == """
23
""" - ) - } - } - test("imageAndDetail") { - val label = Label(as = "a", image = true)(<.img(^.src := "image.jpg"), "img") - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert( - m.innerHTML == """img""" - ) - } - } - test("tag") { - val label = Label(tag = true) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("horizontal") { - val label = Label(horizontal = true) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("floating") { - val label = Label(floating = true) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("circular") { - val label = Label(circular = true) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("empty") { - val label = Label(empty = true, circular = true) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("pointing") { - val label = Label(pointing = LabelPointing.Default) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("pointingBelow") { - val label = Label(pointing = LabelPointing.Below) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("basic") { - val label = Label(basic = true) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("className") { - val label = Label(className = "extra") - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("removeIcon") { - val label = Label(removeIcon = Icon(name = "remove")) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("ribbonDefault") { - val label = Label(ribbon = LabelRibbon.Default) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("ribbonRight") { - val label = Label(ribbon = LabelRibbon.Right) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - test("size") { - val label = Label(size = Big) - ReactTestUtils.withNewBodyElement { m => - label.renderIntoDOM(m) - assert(m.innerHTML == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/list/ListContentSuite.scala b/facade/src/test/scala/react/semanticui/elements/list/ListContentSuite.scala new file mode 100644 index 00000000..7f49be34 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/list/ListContentSuite.scala @@ -0,0 +1,22 @@ +package react.semanticui.elements.list + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ListContentSuite extends munit.FunSuite { + test("render") { + val header = ListContent() + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderAs") { + val header = ListContent(as = <.a) + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/list/ListContentTests.scala b/facade/src/test/scala/react/semanticui/elements/list/ListContentTests.scala deleted file mode 100644 index dcad99ea..00000000 --- a/facade/src/test/scala/react/semanticui/elements/list/ListContentTests.scala +++ /dev/null @@ -1,24 +0,0 @@ -package react.semanticui.elements.list - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ListContentTests extends TestSuite { - val tests = Tests { - test("render") { - val header = ListContent() - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderAs") { - val header = ListContent(as = <.a) - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/list/ListDescriptionSuite.scala b/facade/src/test/scala/react/semanticui/elements/list/ListDescriptionSuite.scala new file mode 100644 index 00000000..e471709a --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/list/ListDescriptionSuite.scala @@ -0,0 +1,22 @@ +package react.semanticui.elements.list + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ListDescriptionSuite extends munit.FunSuite { + test("render") { + val header = ListDescription() + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderAs") { + val header = ListDescription(as = <.a) + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/list/ListDescriptionTests.scala b/facade/src/test/scala/react/semanticui/elements/list/ListDescriptionTests.scala deleted file mode 100644 index 40878a6d..00000000 --- a/facade/src/test/scala/react/semanticui/elements/list/ListDescriptionTests.scala +++ /dev/null @@ -1,24 +0,0 @@ -package react.semanticui.elements.list - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ListDescriptionTests extends TestSuite { - val tests = Tests { - test("render") { - val header = ListDescription() - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderAs") { - val header = ListDescription(as = <.a) - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/list/ListHeaderSuite.scala b/facade/src/test/scala/react/semanticui/elements/list/ListHeaderSuite.scala new file mode 100644 index 00000000..64088a6f --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/list/ListHeaderSuite.scala @@ -0,0 +1,22 @@ +package react.semanticui.elements.list + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ListHeaderSuite extends munit.FunSuite { + test("render") { + val header = ListHeader() + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderAs") { + val header = ListHeader(as = <.a) + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/list/ListHeaderTests.scala b/facade/src/test/scala/react/semanticui/elements/list/ListHeaderTests.scala deleted file mode 100644 index cfb4ce7e..00000000 --- a/facade/src/test/scala/react/semanticui/elements/list/ListHeaderTests.scala +++ /dev/null @@ -1,24 +0,0 @@ -package react.semanticui.elements.list - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ListHeaderTests extends TestSuite { - val tests = Tests { - test("render") { - val header = ListHeader() - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderAs") { - val header = ListHeader(as = <.a) - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/list/ListIconSuite.scala b/facade/src/test/scala/react/semanticui/elements/list/ListIconSuite.scala new file mode 100644 index 00000000..13ecdb7c --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/list/ListIconSuite.scala @@ -0,0 +1,23 @@ +package react.semanticui.elements.list + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class ListIconSuite extends munit.FunSuite { + test("render") { + val header = ListIcon() + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("renderIcon") { + val header = ListIcon("home") + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/list/ListIconTests.scala b/facade/src/test/scala/react/semanticui/elements/list/ListIconTests.scala deleted file mode 100644 index 514dd6be..00000000 --- a/facade/src/test/scala/react/semanticui/elements/list/ListIconTests.scala +++ /dev/null @@ -1,25 +0,0 @@ -package react.semanticui.elements.list - -import utest._ -import japgolly.scalajs.react.test._ - -object ListIconTests extends TestSuite { - val tests = Tests { - test("render") { - val header = ListIcon() - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert(html == """""") - } - } - test("renderIcon") { - val header = ListIcon("home") - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert(html == """""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/list/ListItemSuite.scala b/facade/src/test/scala/react/semanticui/elements/list/ListItemSuite.scala new file mode 100644 index 00000000..5e1d2d8e --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/list/ListItemSuite.scala @@ -0,0 +1,54 @@ +package react.semanticui.elements.list + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ListItemSuite extends munit.FunSuite { + test("render") { + val item = ListItem() + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderAs") { + val item = ListItem(as = <.a) + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } + test("icon") { + val item = ListItem(icon = ListIcon("home")) + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("icon2") { + val item = ListItem(icon = "reply") + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
""" + ) + } + } + test("header") { + val item = ListItem(header = ListHeader(^.color.aqua, "value")) + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
value
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/list/ListItemTests.scala b/facade/src/test/scala/react/semanticui/elements/list/ListItemTests.scala deleted file mode 100644 index 2aa2e1aa..00000000 --- a/facade/src/test/scala/react/semanticui/elements/list/ListItemTests.scala +++ /dev/null @@ -1,53 +0,0 @@ -package react.semanticui.elements.list - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ListItemTests extends TestSuite { - val tests = Tests { - test("render") { - val item = ListItem() - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderAs") { - val item = ListItem(as = <.a) - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - test("icon") { - val item = ListItem(icon = ListIcon("home")) - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("icon2") { - val item = ListItem(icon = "reply") - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert( - html == """
""" - ) - } - } - test("header") { - val item = ListItem(header = ListHeader(^.color.aqua, "value")) - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert( - html == """
value
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/list/ListListSuite.scala b/facade/src/test/scala/react/semanticui/elements/list/ListListSuite.scala new file mode 100644 index 00000000..4c4db844 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/list/ListListSuite.scala @@ -0,0 +1,22 @@ +package react.semanticui.elements.list + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ListListSuite extends munit.FunSuite { + test("render") { + val header = ListList() + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderAs") { + val header = ListList(as = <.a) + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/list/ListListTests.scala b/facade/src/test/scala/react/semanticui/elements/list/ListListTests.scala deleted file mode 100644 index 2284d939..00000000 --- a/facade/src/test/scala/react/semanticui/elements/list/ListListTests.scala +++ /dev/null @@ -1,24 +0,0 @@ -package react.semanticui.elements.list - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ListListTests extends TestSuite { - val tests = Tests { - test("render") { - val header = ListList() - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderAs") { - val header = ListList(as = <.a) - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/list/ListSuite.scala b/facade/src/test/scala/react/semanticui/elements/list/ListSuite.scala new file mode 100644 index 00000000..20c977f9 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/list/ListSuite.scala @@ -0,0 +1,59 @@ +package react.semanticui.elements.list + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ListSuite extends munit.FunSuite { + test("render") { + val item1 = ListItem(value = "a")(^.key := "a")("a") + val item2 = ListItem(value = "b")(^.key := "b")("b") + val list = List(item1, item2) + ReactTestUtils.withNewBodyElement { mountNode => + list.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
a
b
""" + ) + } + } + test("renderAs") { + val item = ListItem(as = <.a) + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """""") + } + } + test("icon") { + val item = ListItem(icon = ListIcon("home")) + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("icon2") { + val item = ListItem(icon = "reply") + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
""" + ) + } + } + test("header") { + val item = ListItem(header = ListHeader("value")) + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
value
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/list/ListTests.scala b/facade/src/test/scala/react/semanticui/elements/list/ListTests.scala deleted file mode 100644 index 6a056e33..00000000 --- a/facade/src/test/scala/react/semanticui/elements/list/ListTests.scala +++ /dev/null @@ -1,57 +0,0 @@ -package react.semanticui.elements.list - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ListTests extends TestSuite { - val tests = Tests { - test("render") { - val item1 = ListItem(value = "a")(^.key := "a")("a") - val item2 = ListItem(value = "b")(^.key := "b")("b") - val list = List(item1, item2) - ReactTestUtils.withNewBodyElement { mountNode => - list.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
a
b
""" - ) - } - } - test("renderAs") { - val item = ListItem(as = <.a) - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert(html == """""") - } - } - test("icon") { - val item = ListItem(icon = ListIcon("home")) - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("icon2") { - val item = ListItem(icon = "reply") - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert( - html == """
""" - ) - } - } - test("header") { - val item = ListItem(header = ListHeader("value")) - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
value
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/loader/LoaderSuite.scala b/facade/src/test/scala/react/semanticui/elements/loader/LoaderSuite.scala new file mode 100644 index 00000000..fd318979 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/loader/LoaderSuite.scala @@ -0,0 +1,40 @@ +package react.semanticui.elements.loader + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.elements.label.Label +import react.common.syntax.vdom._ + +class LoaderSuite extends munit.FunSuite { + test("render") { + val loader = Loader() + ReactTestUtils.withNewBodyElement { mountNode => + loader.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderChild") { + val loader = Loader(<.div("abc")) + ReactTestUtils.withNewBodyElement { mountNode => + loader.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
abc
""") + } + } + test("renderChild2") { + val loader = Loader()(Label("abc")) + ReactTestUtils.withNewBodyElement { mountNode => + loader.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
abc
""" + ) + } + } + test("renderAs") { + val loader = Loader(as = <.a, inverted = true) + ReactTestUtils.withNewBodyElement { mountNode => + loader.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/loader/LoaderTests.scala b/facade/src/test/scala/react/semanticui/elements/loader/LoaderTests.scala deleted file mode 100644 index 45234f2c..00000000 --- a/facade/src/test/scala/react/semanticui/elements/loader/LoaderTests.scala +++ /dev/null @@ -1,41 +0,0 @@ -package react.semanticui.elements.loader - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.elements.label.Label - -object LoaderTest extends TestSuite { - val tests = Tests { - test("render") { - val loader = Loader() - ReactTestUtils.withNewBodyElement { mountNode => - loader.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderChild") { - val loader = Loader(<.div("abc")) - ReactTestUtils.withNewBodyElement { mountNode => - loader.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
abc
""") - } - } - test("renderChild2") { - val loader = Loader()(Label("abc")) - ReactTestUtils.withNewBodyElement { mountNode => - loader.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
abc
""" - ) - } - } - test("renderAs") { - val loader = Loader(as = <.a, inverted = true) - ReactTestUtils.withNewBodyElement { mountNode => - loader.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderHeaderSuite.scala b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderHeaderSuite.scala new file mode 100644 index 00000000..6a2bccc6 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderHeaderSuite.scala @@ -0,0 +1,22 @@ +package react.semanticui.elements.placeholder + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class PlaceholderHeaderSuite extends munit.FunSuite { + test("render") { + val paragraph = PlaceholderHeader() + ReactTestUtils.withNewBodyElement { mountNode => + paragraph.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderChild") { + val paragraph = PlaceholderHeader(<.div("abc")) + ReactTestUtils.withNewBodyElement { mountNode => + paragraph.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderHeaderTests.scala b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderHeaderTests.scala deleted file mode 100644 index d714ce4d..00000000 --- a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderHeaderTests.scala +++ /dev/null @@ -1,24 +0,0 @@ -package react.semanticui.elements.placeholder - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object PlaceholderHeaderTest extends TestSuite { - val tests = Tests { - test("render") { - val paragraph = PlaceholderHeader() - ReactTestUtils.withNewBodyElement { mountNode => - paragraph.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderChild") { - val paragraph = PlaceholderHeader(<.div("abc")) - ReactTestUtils.withNewBodyElement { mountNode => - paragraph.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderImageSuite.scala b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderImageSuite.scala new file mode 100644 index 00000000..6b60b5e0 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderImageSuite.scala @@ -0,0 +1,14 @@ +package react.semanticui.elements.placeholder + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class PlaceholderImageSuite extends munit.FunSuite { + test("render") { + val paragraph = PlaceholderImage() + ReactTestUtils.withNewBodyElement { mountNode => + paragraph.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderImageTests.scala b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderImageTests.scala deleted file mode 100644 index f98be8cd..00000000 --- a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderImageTests.scala +++ /dev/null @@ -1,16 +0,0 @@ -package react.semanticui.elements.placeholder - -import utest._ -import japgolly.scalajs.react.test._ - -object PlaceholderImageTest extends TestSuite { - val tests = Tests { - test("render") { - val paragraph = PlaceholderImage() - ReactTestUtils.withNewBodyElement { mountNode => - paragraph.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderLineSuite.scala b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderLineSuite.scala new file mode 100644 index 00000000..45486bfd --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderLineSuite.scala @@ -0,0 +1,14 @@ +package react.semanticui.elements.placeholder + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class PlaceholderLineSuite extends munit.FunSuite { + test("render") { + val paragraph = PlaceholderLine() + ReactTestUtils.withNewBodyElement { mountNode => + paragraph.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderLineTests.scala b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderLineTests.scala deleted file mode 100644 index 20f4cff7..00000000 --- a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderLineTests.scala +++ /dev/null @@ -1,16 +0,0 @@ -package react.semanticui.elements.placeholder - -import utest._ -import japgolly.scalajs.react.test._ - -object PlaceholderLineTest extends TestSuite { - val tests = Tests { - test("render") { - val paragraph = PlaceholderLine() - ReactTestUtils.withNewBodyElement { mountNode => - paragraph.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderParagraphSuite.scala b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderParagraphSuite.scala new file mode 100644 index 00000000..42cc042b --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderParagraphSuite.scala @@ -0,0 +1,22 @@ +package react.semanticui.elements.placeholder + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class PlaceholderParagraphSuite extends munit.FunSuite { + test("render") { + val paragraph = PlaceholderParagraph() + ReactTestUtils.withNewBodyElement { mountNode => + paragraph.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderChild") { + val paragraph = PlaceholderParagraph(<.div("abc")) + ReactTestUtils.withNewBodyElement { mountNode => + paragraph.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderParagraphTests.scala b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderParagraphTests.scala deleted file mode 100644 index f8138ac8..00000000 --- a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderParagraphTests.scala +++ /dev/null @@ -1,24 +0,0 @@ -package react.semanticui.elements.placeholder - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object PlaceholderParagraphTest extends TestSuite { - val tests = Tests { - test("render") { - val paragraph = PlaceholderParagraph() - ReactTestUtils.withNewBodyElement { mountNode => - paragraph.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderChild") { - val paragraph = PlaceholderParagraph(<.div("abc")) - ReactTestUtils.withNewBodyElement { mountNode => - paragraph.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderSuite.scala b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderSuite.scala new file mode 100644 index 00000000..185f7b1c --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderSuite.scala @@ -0,0 +1,29 @@ +package react.semanticui.elements.placeholder + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class PlaceholderSuite extends munit.FunSuite { + test("render") { + val loader = Placeholder() + ReactTestUtils.withNewBodyElement { mountNode => + loader.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } + test("renderChild") { + val loader = Placeholder(<.div("abc")) + ReactTestUtils.withNewBodyElement { mountNode => + loader.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
abc
""") + } + } + test("renderAs") { + val loader = Placeholder(as = <.a, inverted = true) + ReactTestUtils.withNewBodyElement { mountNode => + loader.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderTests.scala b/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderTests.scala deleted file mode 100644 index 68e2a644..00000000 --- a/facade/src/test/scala/react/semanticui/elements/placeholder/PlaceholderTests.scala +++ /dev/null @@ -1,31 +0,0 @@ -package react.semanticui.elements.placeholder - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object PlaceholderTest extends TestSuite { - val tests = Tests { - test("render") { - val loader = Placeholder() - ReactTestUtils.withNewBodyElement { mountNode => - loader.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - test("renderChild") { - val loader = Placeholder(<.div("abc")) - ReactTestUtils.withNewBodyElement { mountNode => - loader.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
abc
""") - } - } - test("renderAs") { - val loader = Placeholder(as = <.a, inverted = true) - ReactTestUtils.withNewBodyElement { mountNode => - loader.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/rail/RailSuite.scala b/facade/src/test/scala/react/semanticui/elements/rail/RailSuite.scala new file mode 100644 index 00000000..214f6c80 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/rail/RailSuite.scala @@ -0,0 +1,16 @@ +package react.semanticui.elements.rail + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.floats._ +import react.common.syntax.vdom._ + +class RailSuite extends munit.FunSuite { + test("render") { + val rail = Rail(position = Left)("abc") + ReactTestUtils.withNewBodyElement { mountNode => + rail.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/rail/RailTests.scala b/facade/src/test/scala/react/semanticui/elements/rail/RailTests.scala deleted file mode 100644 index 02a0628e..00000000 --- a/facade/src/test/scala/react/semanticui/elements/rail/RailTests.scala +++ /dev/null @@ -1,18 +0,0 @@ -package react.semanticui.elements.rail - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.floats._ - -object RailTests extends TestSuite { - val tests = Tests { - test("render") { - val rail = Rail(position = Left)("abc") - ReactTestUtils.withNewBodyElement { mountNode => - rail.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/segment/SegmentGroupSuite.scala b/facade/src/test/scala/react/semanticui/elements/segment/SegmentGroupSuite.scala new file mode 100644 index 00000000..3f1965df --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/segment/SegmentGroupSuite.scala @@ -0,0 +1,28 @@ +package react.semanticui.elements.segment + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class SegmentGroupSuite extends munit.FunSuite { + test("segment-group") { + val segments = SegmentGroup(Segment("Abc")) + ReactTestUtils.withNewBodyElement { mountNode => + segments.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """
Abc
""") + } + } + test("segment-group with content") { + val segments = + SegmentGroup(horizontal = true)(Segment("Abc"), Segment(secondary = true)(<.div("abc"))) + ReactTestUtils.withNewBodyElement { mountNode => + segments.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
Abc
abc
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/segment/SegmentGroupTests.scala b/facade/src/test/scala/react/semanticui/elements/segment/SegmentGroupTests.scala deleted file mode 100644 index da7891d9..00000000 --- a/facade/src/test/scala/react/semanticui/elements/segment/SegmentGroupTests.scala +++ /dev/null @@ -1,31 +0,0 @@ -package react.semanticui.elements.segment - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object SegmentGroupTests extends TestSuite { - val tests = Tests { - test("segment-group") { - val segments = SegmentGroup(Segment("Abc")) - ReactTestUtils.withNewBodyElement { mountNode => - segments.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert( - html == """
Abc
""" - ) - } - } - test("segment-group with content") { - val segments = - SegmentGroup(horizontal = true)(Segment("Abc"), Segment(secondary = true)(<.div("abc"))) - ReactTestUtils.withNewBodyElement { mountNode => - segments.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert( - html == """
Abc
abc
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/segment/SegmentInlineSuite.scala b/facade/src/test/scala/react/semanticui/elements/segment/SegmentInlineSuite.scala new file mode 100644 index 00000000..cad07d25 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/segment/SegmentInlineSuite.scala @@ -0,0 +1,29 @@ +package react.semanticui.elements.segment + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class SegmentInlineSuite extends munit.FunSuite { + test("segment-inline") { + val segment = Segment(placeholder = true)("Abc", SegmentInline("Def")) + ReactTestUtils.withNewBodyElement { mountNode => + segment.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, + """
Abc
Def
""" + ) + } + } + test("segment-inline with content") { + val segment = Segment(placeholder = true)("Abc", SegmentInline(<.div("def"))) + ReactTestUtils.withNewBodyElement { mountNode => + segment.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
Abc
def
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/segment/SegmentInlineTests.scala b/facade/src/test/scala/react/semanticui/elements/segment/SegmentInlineTests.scala deleted file mode 100644 index 5aff2b12..00000000 --- a/facade/src/test/scala/react/semanticui/elements/segment/SegmentInlineTests.scala +++ /dev/null @@ -1,30 +0,0 @@ -package react.semanticui.elements.segment - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object SegmentInlineTests extends TestSuite { - val tests = Tests { - test("segment-inline") { - val segment = Segment(placeholder = true)("Abc", SegmentInline("Def")) - ReactTestUtils.withNewBodyElement { mountNode => - segment.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert( - html == """
Abc
Def
""" - ) - } - } - test("segment-inline with content") { - val segment = Segment(placeholder = true)("Abc", SegmentInline(<.div("def"))) - ReactTestUtils.withNewBodyElement { mountNode => - segment.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert( - html == """
Abc
def
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/elements/segment/SegmentSuite.scala b/facade/src/test/scala/react/semanticui/elements/segment/SegmentSuite.scala new file mode 100644 index 00000000..2e949b8b --- /dev/null +++ b/facade/src/test/scala/react/semanticui/elements/segment/SegmentSuite.scala @@ -0,0 +1,24 @@ +package react.semanticui.elements.segment + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class SegmentSuite extends munit.FunSuite { + test("segment") { + val segment = Segment("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + segment.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } + test("segment with content") { + val segment = Segment(secondary = true)(<.div("abc")) + ReactTestUtils.withNewBodyElement { mountNode => + segment.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, + """
abc
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/elements/segment/SegmentTests.scala b/facade/src/test/scala/react/semanticui/elements/segment/SegmentTests.scala deleted file mode 100644 index e663202c..00000000 --- a/facade/src/test/scala/react/semanticui/elements/segment/SegmentTests.scala +++ /dev/null @@ -1,24 +0,0 @@ -package react.semanticui.elements.segment - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object SegmentTests extends TestSuite { - val tests = Tests { - test("segment") { - val segment = Segment("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - segment.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - test("segment with content") { - val segment = Segment(secondary = true)(<.div("abc")) - ReactTestUtils.withNewBodyElement { mountNode => - segment.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/accordion/AccordionContentSuite.scala b/facade/src/test/scala/react/semanticui/modules/accordion/AccordionContentSuite.scala new file mode 100644 index 00000000..cb99545d --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/accordion/AccordionContentSuite.scala @@ -0,0 +1,28 @@ +package react.semanticui.modules.accordion + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class AccordionContentSuite extends munit.FunSuite { + test("content") { + val content = AccordionContent(content = "polka") + ReactTestUtils.withNewBodyElement { mountNode => + content.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
polka
""") + } + } + test("apply") { + val content = AccordionContent("zydeco") + ReactTestUtils.withNewBodyElement { mountNode => + content.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
zydeco
""") + } + } + test("active") { + val content = AccordionContent(content = "disco", active = true) + ReactTestUtils.withNewBodyElement { mountNode => + content.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
disco
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/accordion/AccordionContentTests.scala b/facade/src/test/scala/react/semanticui/modules/accordion/AccordionContentTests.scala deleted file mode 100644 index f62a561d..00000000 --- a/facade/src/test/scala/react/semanticui/modules/accordion/AccordionContentTests.scala +++ /dev/null @@ -1,30 +0,0 @@ -package react.semanticui.modules.accordion - -import japgolly.scalajs.react.test._ -import utest._ - -object AccordionContentTests extends TestSuite { - val tests = Tests { - test("content") { - val content = AccordionContent(content = "polka") - ReactTestUtils.withNewBodyElement { mountNode => - content.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
polka
""") - } - } - test("apply") { - val content = AccordionContent("zydeco") - ReactTestUtils.withNewBodyElement { mountNode => - content.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
zydeco
""") - } - } - test("active") { - val content = AccordionContent(content = "disco", active = true) - ReactTestUtils.withNewBodyElement { mountNode => - content.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
disco
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/accordion/AccordionPanelSuite.scala b/facade/src/test/scala/react/semanticui/modules/accordion/AccordionPanelSuite.scala new file mode 100644 index 00000000..c580936c --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/accordion/AccordionPanelSuite.scala @@ -0,0 +1,41 @@ +package react.semanticui.modules.accordion + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class AccordionPanelSuite extends munit.FunSuite { + test("strings") { + val panel = AccordionPanel(title = "The Title", content = "Some Content") + ReactTestUtils.withNewBodyElement { mountNode => + panel.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
The Title
Some Content
""" + ) + } + } + test("classes") { + val title = AccordionTitle("The Title") + val content = AccordionContent("Some Content") + val panel = AccordionPanel(title = title, content = content) + ReactTestUtils.withNewBodyElement { mountNode => + panel.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
The Title
Some Content
""" + ) + } + } + test("active") { + val title = AccordionTitle("The Title") + val content = AccordionContent("Some Content") + val panel = AccordionPanel(title = title, content = content, active = true) + ReactTestUtils.withNewBodyElement { mountNode => + panel.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
The Title
Some Content
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/accordion/AccordionPanelTests.scala b/facade/src/test/scala/react/semanticui/modules/accordion/AccordionPanelTests.scala deleted file mode 100644 index 1528af69..00000000 --- a/facade/src/test/scala/react/semanticui/modules/accordion/AccordionPanelTests.scala +++ /dev/null @@ -1,40 +0,0 @@ -package react.semanticui.modules.accordion - -import japgolly.scalajs.react.test._ -import utest._ - -object AccordionPanelTests extends TestSuite { - val tests = Tests { - test("strings") { - val panel = AccordionPanel(title = "The Title", content = "Some Content") - ReactTestUtils.withNewBodyElement { mountNode => - panel.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
The Title
Some Content
""" - ) - } - } - test("classes") { - val title = AccordionTitle("The Title") - val content = AccordionContent("Some Content") - val panel = AccordionPanel(title = title, content = content) - ReactTestUtils.withNewBodyElement { mountNode => - panel.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
The Title
Some Content
""" - ) - } - } - test("active") { - val title = AccordionTitle("The Title") - val content = AccordionContent("Some Content") - val panel = AccordionPanel(title = title, content = content, active = true) - ReactTestUtils.withNewBodyElement { mountNode => - panel.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
The Title
Some Content
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/accordion/AccordionSuite.scala b/facade/src/test/scala/react/semanticui/modules/accordion/AccordionSuite.scala new file mode 100644 index 00000000..b710b048 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/accordion/AccordionSuite.scala @@ -0,0 +1,134 @@ +package react.semanticui.modules.accordion + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class AccordionSuite extends munit.FunSuite { + test("single") { + val panel = AccordionPanel(title = "The Title", content = "Some Content") + val accordion = Accordion(panels = Seq(panel)) + ReactTestUtils.withNewBodyElement { mountNode => + accordion.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
The Title
Some Content
""" + ) + } + } + test("single") { + val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") + val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") + val accordion = Accordion(panels = Seq(panel1, panel2)) + ReactTestUtils.withNewBodyElement { mountNode => + accordion.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Title 1
Content 1
Title 2
Content 2
""" + ) + } + } + test("styled") { + val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") + val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") + val accordion = Accordion(panels = Seq(panel1, panel2), styled = true) + ReactTestUtils.withNewBodyElement { mountNode => + accordion.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Title 1
Content 1
Title 2
Content 2
""" + ) + } + } + test("fluid") { + val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") + val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") + val accordion = Accordion(panels = Seq(panel1, panel2), fluid = true) + ReactTestUtils.withNewBodyElement { mountNode => + accordion.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Title 1
Content 1
Title 2
Content 2
""" + ) + } + } + test("inverted") { + val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") + val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") + val accordion = Accordion(panels = Seq(panel1, panel2), inverted = true) + ReactTestUtils.withNewBodyElement { mountNode => + accordion.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Title 1
Content 1
Title 2
Content 2
""" + ) + } + } + test("exclusive") { + val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") + val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") + val accordion = Accordion(panels = Seq(panel1, panel2), exclusive = true) + ReactTestUtils.withNewBodyElement { mountNode => + accordion.renderIntoDOM(mountNode) + // does not affect the html + assertEquals( + mountNode.innerHTML, + """
Title 1
Content 1
Title 2
Content 2
""" + ) + } + } + test("all options") { + val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") + val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") + val accordion = + Accordion(panels = Seq(panel1, panel2), styled = true, fluid = true, inverted = true) + ReactTestUtils.withNewBodyElement { mountNode => + accordion.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Title 1
Content 1
Title 2
Content 2
""" + ) + } + } + test("one active") { + val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") + val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") + val accordion = Accordion(panels = Seq(panel1, panel2), defaultActiveIndex = 1) + ReactTestUtils.withNewBodyElement { mountNode => + accordion.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Title 1
Content 1
Title 2
Content 2
""" + ) + } + } + test("all active") { + val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") + val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") + val accordion = + Accordion(panels = Seq(panel1, panel2), exclusive = false, defaultActiveIndex = List(0, 1)) + ReactTestUtils.withNewBodyElement { mountNode => + accordion.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Title 1
Content 1
Title 2
Content 2
""" + ) + } + } + test("some active") { + val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") + val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") + val panel3 = AccordionPanel(title = "Title 3", content = "Content 3") + val accordion = + Accordion(panels = Seq(panel1, panel2, panel3), + exclusive = false, + defaultActiveIndex = List(0, 2) + ) + ReactTestUtils.withNewBodyElement { mountNode => + accordion.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Title 1
Content 1
Title 2
Content 2
Title 3
Content 3
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/accordion/AccordionTests.scala b/facade/src/test/scala/react/semanticui/modules/accordion/AccordionTests.scala deleted file mode 100644 index 2032cfb5..00000000 --- a/facade/src/test/scala/react/semanticui/modules/accordion/AccordionTests.scala +++ /dev/null @@ -1,126 +0,0 @@ -package react.semanticui.modules.accordion - -import japgolly.scalajs.react.test._ -import utest._ - -object AccordionTests extends TestSuite { - val tests = Tests { - test("single") { - val panel = AccordionPanel(title = "The Title", content = "Some Content") - val accordion = Accordion(panels = Seq(panel)) - ReactTestUtils.withNewBodyElement { mountNode => - accordion.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
The Title
Some Content
""" - ) - } - } - test("single") { - val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") - val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") - val accordion = Accordion(panels = Seq(panel1, panel2)) - ReactTestUtils.withNewBodyElement { mountNode => - accordion.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Title 1
Content 1
Title 2
Content 2
""" - ) - } - } - test("styled") { - val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") - val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") - val accordion = Accordion(panels = Seq(panel1, panel2), styled = true) - ReactTestUtils.withNewBodyElement { mountNode => - accordion.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Title 1
Content 1
Title 2
Content 2
""" - ) - } - } - test("fluid") { - val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") - val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") - val accordion = Accordion(panels = Seq(panel1, panel2), fluid = true) - ReactTestUtils.withNewBodyElement { mountNode => - accordion.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Title 1
Content 1
Title 2
Content 2
""" - ) - } - } - test("inverted") { - val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") - val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") - val accordion = Accordion(panels = Seq(panel1, panel2), inverted = true) - ReactTestUtils.withNewBodyElement { mountNode => - accordion.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Title 1
Content 1
Title 2
Content 2
""" - ) - } - } - test("exclusive") { - val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") - val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") - val accordion = Accordion(panels = Seq(panel1, panel2), exclusive = true) - ReactTestUtils.withNewBodyElement { mountNode => - accordion.renderIntoDOM(mountNode) - // does not affect the html - assert( - mountNode.innerHTML == """
Title 1
Content 1
Title 2
Content 2
""" - ) - } - } - test("all options") { - val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") - val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") - val accordion = - Accordion(panels = Seq(panel1, panel2), styled = true, fluid = true, inverted = true) - ReactTestUtils.withNewBodyElement { mountNode => - accordion.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Title 1
Content 1
Title 2
Content 2
""" - ) - } - } - test("one active") { - val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") - val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") - val accordion = Accordion(panels = Seq(panel1, panel2), defaultActiveIndex = 1) - ReactTestUtils.withNewBodyElement { mountNode => - accordion.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Title 1
Content 1
Title 2
Content 2
""" - ) - } - } - test("all active") { - val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") - val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") - val accordion = - Accordion(panels = Seq(panel1, panel2), exclusive = false, defaultActiveIndex = List(0, 1)) - ReactTestUtils.withNewBodyElement { mountNode => - accordion.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Title 1
Content 1
Title 2
Content 2
""" - ) - } - } - test("some active") { - val panel1 = AccordionPanel(title = "Title 1", content = "Content 1") - val panel2 = AccordionPanel(title = "Title 2", content = "Content 2") - val panel3 = AccordionPanel(title = "Title 3", content = "Content 3") - val accordion = - Accordion(panels = Seq(panel1, panel2, panel3), - exclusive = false, - defaultActiveIndex = List(0, 2) - ) - ReactTestUtils.withNewBodyElement { mountNode => - accordion.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Title 1
Content 1
Title 2
Content 2
Title 3
Content 3
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/accordion/AccordionTitleSuite.scala b/facade/src/test/scala/react/semanticui/modules/accordion/AccordionTitleSuite.scala new file mode 100644 index 00000000..84053250 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/accordion/AccordionTitleSuite.scala @@ -0,0 +1,48 @@ +package react.semanticui.modules.accordion + +import japgolly.scalajs.react.test._ +import react.semanticui.elements.icon._ +import react.common.syntax.vdom._ + +class AccordionTitleSuite extends munit.FunSuite { + test("content") { + val title = AccordionTitle(content = "Señor") + ReactTestUtils.withNewBodyElement { mountNode => + title.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Señor
""" + ) + } + } + test("content") { + val title = AccordionTitle("Señora") + ReactTestUtils.withNewBodyElement { mountNode => + title.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Señora
""" + ) + } + } + test("active") { + val title = AccordionTitle(content = "Médico", active = true) + ReactTestUtils.withNewBodyElement { mountNode => + title.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Médico
""" + ) + } + } + test("icon") { + val title = AccordionTitle(content = "Profesora", icon = Icon("home")) + ReactTestUtils.withNewBodyElement { mountNode => + title.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Profesora
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/accordion/AccordionTitleTests.scala b/facade/src/test/scala/react/semanticui/modules/accordion/AccordionTitleTests.scala deleted file mode 100644 index 6de1b6a4..00000000 --- a/facade/src/test/scala/react/semanticui/modules/accordion/AccordionTitleTests.scala +++ /dev/null @@ -1,46 +0,0 @@ -package react.semanticui.modules.accordion - -import japgolly.scalajs.react.test._ -import react.semanticui.elements.icon._ -import utest._ - -object AccordionTitleTests extends TestSuite { - val tests = Tests { - test("content") { - val title = AccordionTitle(content = "Señor") - ReactTestUtils.withNewBodyElement { mountNode => - title.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Señor
""" - ) - } - } - test("content") { - val title = AccordionTitle("Señora") - ReactTestUtils.withNewBodyElement { mountNode => - title.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Señora
""" - ) - } - } - test("active") { - val title = AccordionTitle(content = "Médico", active = true) - ReactTestUtils.withNewBodyElement { mountNode => - title.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Médico
""" - ) - } - } - test("icon") { - val title = AccordionTitle(content = "Profesora", icon = Icon("home")) - ReactTestUtils.withNewBodyElement { mountNode => - title.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Profesora
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/checkbox/CheckboxTests.scala b/facade/src/test/scala/react/semanticui/modules/checkbox/CheckboxTests.scala index d70bcd99..d2adcf8d 100644 --- a/facade/src/test/scala/react/semanticui/modules/checkbox/CheckboxTests.scala +++ b/facade/src/test/scala/react/semanticui/modules/checkbox/CheckboxTests.scala @@ -1,29 +1,29 @@ package react.semanticui.modules.checkbox -import utest._ import japgolly.scalajs.react.test._ import japgolly.scalajs.react.Callback +import react.common.syntax.vdom._ -object CheckboxTests extends TestSuite { - val tests = Tests { - test("render") { - val check = Checkbox() - ReactTestUtils.withNewBodyElement { mountNode => - check.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } +class CheckboxSuite extends munit.FunSuite { + test("render") { + val check = Checkbox() + ReactTestUtils.withNewBodyElement { mountNode => + check.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) } - test("boolean callback") { - val cb = (b: Boolean) => Callback.log(b) - val check = Checkbox(onChange = cb) - ReactTestUtils.withNewBodyElement { mountNode => - check.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } + } + test("boolean callback") { + val cb = (b: Boolean) => Callback.log(b) + val check = Checkbox(onChange = cb) + ReactTestUtils.withNewBodyElement { mountNode => + check.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) } } } diff --git a/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerDimmableSuite.scala b/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerDimmableSuite.scala new file mode 100644 index 00000000..af92f603 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerDimmableSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.modules.dimmer + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class DimmerDimmableSuite extends munit.FunSuite { + test("dimmer") { + val dimmer = DimmerDimmable("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + dimmer.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerDimmableTests.scala b/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerDimmableTests.scala deleted file mode 100644 index 0d8f32ca..00000000 --- a/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerDimmableTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.modules.dimmer - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object DimmerDimmableTests extends TestSuite { - val tests = Tests { - test("dimmer") { - val dimmer = DimmerDimmable("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - dimmer.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerInnerSuite.scala b/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerInnerSuite.scala new file mode 100644 index 00000000..eab3d45a --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerInnerSuite.scala @@ -0,0 +1,18 @@ +package react.semanticui.modules.dimmer + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class DimmerInnerSuite extends munit.FunSuite { + test("render") { + val dimmerInner = DimmerInner("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + dimmerInner.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Abc
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerInnerTests.scala b/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerInnerTests.scala deleted file mode 100644 index c386b57f..00000000 --- a/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerInnerTests.scala +++ /dev/null @@ -1,19 +0,0 @@ -package react.semanticui.modules.dimmer - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object DimmerInnerTests extends TestSuite { - val tests = Tests { - test("render") { - val dimmerInner = DimmerInner("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - dimmerInner.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Abc
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerSuite.scala b/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerSuite.scala new file mode 100644 index 00000000..ac256d31 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerSuite.scala @@ -0,0 +1,17 @@ +package react.semanticui.modules.dimmer + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class DimmerSuite extends munit.FunSuite { + test("dimmer") { + val dimmer = Dimmer() + ReactTestUtils.withNewBodyElement { mountNode => + dimmer.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerTests.scala b/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerTests.scala deleted file mode 100644 index d01ebbf4..00000000 --- a/facade/src/test/scala/react/semanticui/modules/dimmer/DimmerTests.scala +++ /dev/null @@ -1,18 +0,0 @@ -package react.semanticui.modules.dimmer - -import utest._ -import japgolly.scalajs.react.test._ - -object DimmerTests extends TestSuite { - val tests = Tests { - test("dimmer") { - val dimmer = Dimmer() - ReactTestUtils.withNewBodyElement { mountNode => - dimmer.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownDividerSuite.scala b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownDividerSuite.scala new file mode 100644 index 00000000..f8d9109f --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownDividerSuite.scala @@ -0,0 +1,18 @@ +package react.semanticui.modules.dropdown + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class DropdownDividerSuite extends munit.FunSuite { + test("pusher") { + val pusher = DropdownDivider("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + pusher.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Abc
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownDividerTests.scala b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownDividerTests.scala deleted file mode 100644 index 564581ee..00000000 --- a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownDividerTests.scala +++ /dev/null @@ -1,19 +0,0 @@ -package react.semanticui.modules.dropdown - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object DropdownDividerTests extends TestSuite { - val tests = Tests { - test("pusher") { - val pusher = DropdownDivider("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - pusher.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Abc
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownHeaderSuite.scala b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownHeaderSuite.scala new file mode 100644 index 00000000..0218547c --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownHeaderSuite.scala @@ -0,0 +1,25 @@ +package react.semanticui.modules.dropdown + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class DropdownHeaderSuite extends munit.FunSuite { + test("header") { + val header = DropdownHeader() + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("headerContent") { + val header = DropdownHeader("content") + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
content
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownHeaderTests.scala b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownHeaderTests.scala deleted file mode 100644 index 17beb643..00000000 --- a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownHeaderTests.scala +++ /dev/null @@ -1,28 +0,0 @@ -package react.semanticui.modules.dropdown - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object DropdownHeaderTests extends TestSuite { - val tests = Tests { - test("header") { - val header = DropdownHeader() - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("headerContent") { - val header = DropdownHeader("content") - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
content
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownItemSuite.scala b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownItemSuite.scala new file mode 100644 index 00000000..e251c05d --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownItemSuite.scala @@ -0,0 +1,94 @@ +package react.semanticui.modules.dropdown + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.elements.icon._ +import react.semanticui.elements.flag.Flag +import react.semanticui.elements.image.Image +import react.semanticui.elements.label.Label +import react.common.syntax.vdom._ + +class DropdownItemSuite extends munit.FunSuite { + test("item") { + val item = DropdownItem("Option 1") + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Option 1
""" + ) + } + } + test("itemDescriptionString") { + val item = DropdownItem(description = "some description") + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
some description
""" + ) + } + } + test("itemValue") { + val item = DropdownItem(1) + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
1
""" + ) + } + } + test("itemValueChild") { + val item = DropdownItem(value = 1)(<.div("abc")) + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
abc
""" + ) + } + } + test("icon") { + val item = DropdownItem(value = 1, icon = Icon("edit")) + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("flag") { + val item = DropdownItem(value = 1, flag = Flag("cl")) + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("image") { + val item = DropdownItem(value = 1, image = Image(href = "image")) + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("label") { + val item = DropdownItem(value = 1, label = Label("image")) + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals( + html, + """
image
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownItemTests.scala b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownItemTests.scala deleted file mode 100644 index bb27d541..00000000 --- a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownItemTests.scala +++ /dev/null @@ -1,88 +0,0 @@ -package react.semanticui.modules.dropdown - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.semanticui.elements.icon._ -import react.semanticui.elements.flag.Flag -import react.semanticui.elements.image.Image -import react.semanticui.elements.label.Label - -object DropdownItemTests extends TestSuite { - val tests = Tests { - test("item") { - val item = DropdownItem("Option 1") - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Option 1
""" - ) - } - } - test("itemDescriptionString") { - val item = DropdownItem(description = "some description") - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
some description
""" - ) - } - } - test("itemValue") { - val item = DropdownItem(1) - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
1
""" - ) - } - } - test("itemValueChild") { - val item = DropdownItem(value = 1)(<.div("abc")) - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert( - html == """
abc
""" - ) - } - } - test("icon") { - val item = DropdownItem(value = 1, icon = Icon("edit")) - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("flag") { - val item = DropdownItem(value = 1, flag = Flag("cl")) - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("image") { - val item = DropdownItem(value = 1, image = Image(href = "image")) - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("label") { - val item = DropdownItem(value = 1, label = Label("image")) - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert( - html == """
image
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownMenuTests.scala b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownMenuTests.scala index 1c82a544..3e2443cc 100644 --- a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownMenuTests.scala +++ b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownMenuTests.scala @@ -1,28 +1,28 @@ package react.semanticui.modules.dropdown -import utest._ import japgolly.scalajs.react.test._ import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ -object DropdownMenuTests extends TestSuite { - val tests = Tests { - test("menu") { - val menu = DropdownMenu() - ReactTestUtils.withNewBodyElement { mountNode => - menu.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } +class DropdownMenuSuite extends munit.FunSuite { + test("menu") { + val menu = DropdownMenu() + ReactTestUtils.withNewBodyElement { mountNode => + menu.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) } - test("menuContent") { - val menu = DropdownMenu("content") - ReactTestUtils.withNewBodyElement { mountNode => - menu.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } + } + test("menuContent") { + val menu = DropdownMenu("content") + ReactTestUtils.withNewBodyElement { mountNode => + menu.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) } } } diff --git a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownSearchInputSuite.scala b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownSearchInputSuite.scala new file mode 100644 index 00000000..6ed168c9 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownSearchInputSuite.scala @@ -0,0 +1,17 @@ +package react.semanticui.modules.dropdown + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class DropdownSearchInputSuite extends munit.FunSuite { + test("pusher") { + val pusher = DropdownSearchInput() + ReactTestUtils.withNewBodyElement { mountNode => + pusher.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownSearchInputTests.scala b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownSearchInputTests.scala deleted file mode 100644 index 809db582..00000000 --- a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownSearchInputTests.scala +++ /dev/null @@ -1,18 +0,0 @@ -package react.semanticui.modules.dropdown - -import utest._ -import japgolly.scalajs.react.test._ - -object DropdownSearchInputTests extends TestSuite { - val tests = Tests { - test("pusher") { - val pusher = DropdownSearchInput() - ReactTestUtils.withNewBodyElement { mountNode => - pusher.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownSuite.scala b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownSuite.scala new file mode 100644 index 00000000..fa43c943 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownSuite.scala @@ -0,0 +1,60 @@ +package react.semanticui.modules.dropdown + +import japgolly.scalajs.react.test._ +import react.common.syntax.vdom._ + +class DropdownSuite extends munit.FunSuite { + test("dropdown") { + val dropdown = Dropdown() + ReactTestUtils.withNewBodyElement { mountNode => + dropdown.renderIntoDOM(mountNode) + assertEquals( + mountNode.outerHTML, + """
""" + ) + } + } + test("options") { + val options = + List(DropdownItem("abc"), DropdownItem(text = "def", value = 2)) + val dropdown = Dropdown(options = options) + ReactTestUtils.withNewBodyElement { mountNode => + dropdown.renderIntoDOM(mountNode) + val html = mountNode.outerHTML + assertEquals( + html, + """
""" + ) + } + } + test("additionLabel") { + val options = + List(DropdownItem("abc"), DropdownItem(text = "def", value = 2)) + val dropdown = Dropdown(options = options, + selection = false, + search = true, + defaultOpen = true, + additionPosition = AdditionPosition.Top, + allowAdditions = true, + additionLabel = "add" + ) + ReactTestUtils.withNewBodyElement { mountNode => + dropdown.renderIntoDOM(mountNode) + val html = mountNode.outerHTML + assertEquals( + html, + """
""" + ) + } + } + test("basic") { + val dropdown = Dropdown(basic = true) + ReactTestUtils.withNewBodyElement { mountNode => + dropdown.renderIntoDOM(mountNode) + assertEquals( + mountNode.outerHTML, + """
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownTests.scala b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownTests.scala deleted file mode 100644 index 022bd2da..00000000 --- a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownTests.scala +++ /dev/null @@ -1,58 +0,0 @@ -package react.semanticui.modules.dropdown - -import utest._ -import japgolly.scalajs.react.test._ - -object DropdownTests extends TestSuite { - val tests = Tests { - test("dropdown") { - val dropdown = Dropdown() - ReactTestUtils.withNewBodyElement { mountNode => - dropdown.renderIntoDOM(mountNode) - assert( - mountNode.outerHTML == """
""" - ) - } - } - test("options") { - val options = - List(DropdownItem("abc"), DropdownItem(text = "def", value = 2)) - val dropdown = Dropdown(options = options) - ReactTestUtils.withNewBodyElement { mountNode => - dropdown.renderIntoDOM(mountNode) - val html = mountNode.outerHTML - assert( - html == """
""" - ) - } - } - test("additionLabel") { - val options = - List(DropdownItem("abc"), DropdownItem(text = "def", value = 2)) - val dropdown = Dropdown(options = options, - selection = false, - search = true, - defaultOpen = true, - additionPosition = AdditionPosition.Top, - allowAdditions = true, - additionLabel = "add" - ) - ReactTestUtils.withNewBodyElement { mountNode => - dropdown.renderIntoDOM(mountNode) - val html = mountNode.outerHTML - assert( - html == """
""" - ) - } - } - test("basic") { - val dropdown = Dropdown(basic = true) - ReactTestUtils.withNewBodyElement { mountNode => - dropdown.renderIntoDOM(mountNode) - assert( - mountNode.outerHTML == """
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownTextSuite.scala b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownTextSuite.scala new file mode 100644 index 00000000..af79524e --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownTextSuite.scala @@ -0,0 +1,28 @@ +package react.semanticui.modules.dropdown + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class DropdownTextSuite extends munit.FunSuite { + test("text") { + val header = DropdownText() + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } + test("textContent") { + val header = DropdownText("content") + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownTextTests.scala b/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownTextTests.scala deleted file mode 100644 index 297d3167..00000000 --- a/facade/src/test/scala/react/semanticui/modules/dropdown/DropdownTextTests.scala +++ /dev/null @@ -1,28 +0,0 @@ -package react.semanticui.modules.dropdown - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object DropdownTextTests extends TestSuite { - val tests = Tests { - test("text") { - val header = DropdownText() - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } - } - test("textContent") { - val header = DropdownText("content") - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/modal/ModalActionsSuite.scala b/facade/src/test/scala/react/semanticui/modules/modal/ModalActionsSuite.scala new file mode 100644 index 00000000..b5e262f0 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/modal/ModalActionsSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.modules.modal + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ModalActionsSuite extends munit.FunSuite { + test("render") { + val modal = ModalActions("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + modal.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/modal/ModalActionsTests.scala b/facade/src/test/scala/react/semanticui/modules/modal/ModalActionsTests.scala deleted file mode 100644 index 5eb16bd0..00000000 --- a/facade/src/test/scala/react/semanticui/modules/modal/ModalActionsTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.modules.modal - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ModalActionsTests extends TestSuite { - val tests = Tests { - test("render") { - val modal = ModalActions("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - modal.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/modal/ModalContentSuite.scala b/facade/src/test/scala/react/semanticui/modules/modal/ModalContentSuite.scala new file mode 100644 index 00000000..244e1963 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/modal/ModalContentSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.modules.modal + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ModalContentSuite extends munit.FunSuite { + test("render") { + val modal = ModalContent("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + modal.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/modal/ModalContentTests.scala b/facade/src/test/scala/react/semanticui/modules/modal/ModalContentTests.scala deleted file mode 100644 index da22f4ae..00000000 --- a/facade/src/test/scala/react/semanticui/modules/modal/ModalContentTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.modules.modal - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ModalContentTests extends TestSuite { - val tests = Tests { - test("render") { - val modal = ModalContent("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - modal.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/modal/ModalDescriptionSuite.scala b/facade/src/test/scala/react/semanticui/modules/modal/ModalDescriptionSuite.scala new file mode 100644 index 00000000..10fca451 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/modal/ModalDescriptionSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.modules.modal + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ModalDescriptionSuite extends munit.FunSuite { + test("render") { + val modal = ModalDescription("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + modal.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/modal/ModalDescriptionTests.scala b/facade/src/test/scala/react/semanticui/modules/modal/ModalDescriptionTests.scala deleted file mode 100644 index 0df9d707..00000000 --- a/facade/src/test/scala/react/semanticui/modules/modal/ModalDescriptionTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.modules.modal - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ModalDescriptionTests extends TestSuite { - val tests = Tests { - test("render") { - val modal = ModalDescription("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - modal.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/modal/ModalDimmerSuite.scala b/facade/src/test/scala/react/semanticui/modules/modal/ModalDimmerSuite.scala new file mode 100644 index 00000000..03f49017 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/modal/ModalDimmerSuite.scala @@ -0,0 +1,18 @@ +package react.semanticui.modules.modal + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ModalDimmerSuite extends munit.FunSuite { + test("render") { + val modal = ModalDimmer("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + modal.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Abc
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/modal/ModalDimmerTests.scala b/facade/src/test/scala/react/semanticui/modules/modal/ModalDimmerTests.scala deleted file mode 100644 index 72059398..00000000 --- a/facade/src/test/scala/react/semanticui/modules/modal/ModalDimmerTests.scala +++ /dev/null @@ -1,19 +0,0 @@ -package react.semanticui.modules.modal - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ModalDimmerTests extends TestSuite { - val tests = Tests { - test("render") { - val modal = ModalDimmer("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - modal.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Abc
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/modal/ModalHeaderSuite.scala b/facade/src/test/scala/react/semanticui/modules/modal/ModalHeaderSuite.scala new file mode 100644 index 00000000..353f5a7f --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/modal/ModalHeaderSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.modules.modal + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ModalHeaderSuite extends munit.FunSuite { + test("render") { + val header = ModalHeader("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/modal/ModalHeaderTests.scala b/facade/src/test/scala/react/semanticui/modules/modal/ModalHeaderTests.scala deleted file mode 100644 index 78067b02..00000000 --- a/facade/src/test/scala/react/semanticui/modules/modal/ModalHeaderTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.modules.modal - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ModalHeaderTests extends TestSuite { - val tests = Tests { - test("render") { - val header = ModalHeader("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/modal/ModalSuite.scala b/facade/src/test/scala/react/semanticui/modules/modal/ModalSuite.scala new file mode 100644 index 00000000..77b73eee --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/modal/ModalSuite.scala @@ -0,0 +1,17 @@ +package react.semanticui.modules.modal + +// import japgolly.scalajs.react.test._ +// import japgolly.scalajs.react.vdom.html_<^._ + +class ModalSuite extends munit.FunSuite { + test("render") { + // Modal cannot be tested without anmiationFrame + // val pusher = Modal(Modal.props(), "Abc") + // ReactTestUtils.withNewBodyElement { mountNode => + // pusher.renderIntoDOM(mountNode) + // println(mountNode.outerHTML) + // assert(mountNode.outerHTML == """
Abc
""") + // } + assert(true) + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/modal/ModalTests.scala b/facade/src/test/scala/react/semanticui/modules/modal/ModalTests.scala deleted file mode 100644 index 0d21889f..00000000 --- a/facade/src/test/scala/react/semanticui/modules/modal/ModalTests.scala +++ /dev/null @@ -1,20 +0,0 @@ -package react.semanticui.modules.modal - -import utest._ -// import japgolly.scalajs.react.test._ -// import japgolly.scalajs.react.vdom.html_<^._ - -object ModalTests extends TestSuite { - val tests = Tests { - test("render") { - // Modal cannot be tested without anmiationFrame - // val pusher = Modal(Modal.props(), "Abc") - // ReactTestUtils.withNewBodyElement { mountNode => - // pusher.renderIntoDOM(mountNode) - // println(mountNode.outerHTML) - // assert(mountNode.outerHTML == """
Abc
""") - // } - assert(true) - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/popup/PopupContentSuite.scala b/facade/src/test/scala/react/semanticui/modules/popup/PopupContentSuite.scala new file mode 100644 index 00000000..a2ea5f8c --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/popup/PopupContentSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.modules.popup + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class PopupContentSuite extends munit.FunSuite { + test("render") { + val popup = PopupContent("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + popup.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/popup/PopupContentTests.scala b/facade/src/test/scala/react/semanticui/modules/popup/PopupContentTests.scala deleted file mode 100644 index 4939904c..00000000 --- a/facade/src/test/scala/react/semanticui/modules/popup/PopupContentTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.modules.popup - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object PopupContentTests extends TestSuite { - val tests = Tests { - test("render") { - val popup = PopupContent("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - popup.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/popup/PopupHeaderSuite.scala b/facade/src/test/scala/react/semanticui/modules/popup/PopupHeaderSuite.scala new file mode 100644 index 00000000..eb109348 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/popup/PopupHeaderSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.modules.popup + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class PopupHeaderSuite extends munit.FunSuite { + test("render") { + val popup = PopupHeader("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + popup.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/popup/PopupHeaderTests.scala b/facade/src/test/scala/react/semanticui/modules/popup/PopupHeaderTests.scala deleted file mode 100644 index 3239ff45..00000000 --- a/facade/src/test/scala/react/semanticui/modules/popup/PopupHeaderTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.modules.popup - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object PopupHeaderTests extends TestSuite { - val tests = Tests { - test("render") { - val popup = PopupHeader("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - popup.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/popup/PopupSuite.scala b/facade/src/test/scala/react/semanticui/modules/popup/PopupSuite.scala new file mode 100644 index 00000000..530677e9 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/popup/PopupSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.modules.popup + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class PopupSuite extends munit.FunSuite { + test("render") { + val popup = Popup("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + popup.renderIntoDOM(mountNode) + assertEquals(mountNode.outerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/popup/PopupTests.scala b/facade/src/test/scala/react/semanticui/modules/popup/PopupTests.scala deleted file mode 100644 index f1bb12ba..00000000 --- a/facade/src/test/scala/react/semanticui/modules/popup/PopupTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.modules.popup - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object PopupTests extends TestSuite { - val tests = Tests { - test("render") { - val popup = Popup("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - popup.renderIntoDOM(mountNode) - assert(mountNode.outerHTML == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/progress/ProgressSuite.scala b/facade/src/test/scala/react/semanticui/modules/progress/ProgressSuite.scala new file mode 100644 index 00000000..5ae49f10 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/progress/ProgressSuite.scala @@ -0,0 +1,18 @@ +package react.semanticui.modules.progress + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ProgressSuite extends munit.FunSuite { + test("progress") { + val progress = Progress("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + progress.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Abc
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/progress/ProgressTests.scala b/facade/src/test/scala/react/semanticui/modules/progress/ProgressTests.scala deleted file mode 100644 index 86a8ee12..00000000 --- a/facade/src/test/scala/react/semanticui/modules/progress/ProgressTests.scala +++ /dev/null @@ -1,19 +0,0 @@ -package react.semanticui.modules.progress - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ProgressTest extends TestSuite { - val tests = Tests { - test("progress") { - val progress = Progress("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - progress.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Abc
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/sidebar/SidebarSuite.scala b/facade/src/test/scala/react/semanticui/modules/sidebar/SidebarSuite.scala new file mode 100644 index 00000000..557a7fbb --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/sidebar/SidebarSuite.scala @@ -0,0 +1,102 @@ +package react.semanticui.modules.sidebar + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import japgolly.scalajs.react.ScalaComponent +import react.semanticui.collections.menu._ +import react.semanticui.elements.icon._ +import react.semanticui.As +import react.common.syntax.vdom._ + +class SidebarSuite extends munit.FunSuite { + val DoubleComp = ScalaComponent + .builder[Int]("Doubler") + .render_P(i => <.p(s"$i + $i = ${i << 1}")) + .build + + test("pusher") { + val pusher = SidebarPusher("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + pusher.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } + test("pushable") { + val pushable = SidebarPushable("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + pushable.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } + test("pushableAs") { + val pushable = SidebarPushable(as = As.Segment())("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + pushable.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } + test("sidebar") { + val sidebar = Sidebar(DoubleComp(1)) + ReactTestUtils.withNewBodyElement { mountNode => + sidebar.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } + test("sidebarAs") { + val sidebar = Sidebar(as = As.Menu(Menu(inverted = true)))("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + sidebar.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """""" + ) + } + } + test("example") { + val sidebar = + <.div( + Menu( + attached = MenuAttached.Top, + compact = true, + borderless = true, + tabular = MenuTabular.Right + )( + MenuItem(as = "a")( + Icon("bars"), + "Formerly known as OT" + ) + ), + SidebarPushable(className = "maingrid")( + Sidebar( + as = As.Menu( + Menu( + inverted = true, + vertical = true, + icon = MenuIcon.Labeled + ) + ), + width = SidebarWidth.Thin, + animation = SidebarAnimation.Push, + direction = SidebarDirection.Left, + visible = true + )( + MenuItem(as = "a")(Icon("home"), "P I"), + MenuItem(as = "a")(Icon("home"), "P II") + ), + SidebarPusher(dimmed = true)( + <.div("Main") + ) + ) + ) + ReactTestUtils.withNewBodyElement { mountNode => + sidebar.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Main
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/sidebar/SidebarTests.scala b/facade/src/test/scala/react/semanticui/modules/sidebar/SidebarTests.scala deleted file mode 100644 index 6578e76c..00000000 --- a/facade/src/test/scala/react/semanticui/modules/sidebar/SidebarTests.scala +++ /dev/null @@ -1,98 +0,0 @@ -package react.semanticui.modules.sidebar - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import japgolly.scalajs.react.ScalaComponent -import react.semanticui.collections.menu._ -import react.semanticui.elements.icon._ -import react.semanticui.As -import react.common._ - -object SidebarTests extends TestSuite { - val DoubleComp = ScalaComponent - .builder[Int]("Doubler") - .render_P(i => <.p(s"$i + $i = ${i << 1}")) - .build - - val tests = Tests { - test("pusher") { - val pusher = SidebarPusher("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - pusher.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - test("pushable") { - val pushable = SidebarPushable("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - pushable.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - test("pushableAs") { - val pushable = SidebarPushable(as = As.Segment())("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - pushable.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - test("sidebar") { - val sidebar = Sidebar(DoubleComp(1)) - ReactTestUtils.withRenderedIntoDocument(sidebar) { m => - assert(m.outerHtmlScrubbed() == """""") - } - } - test("sidebarAs") { - val sidebar = Sidebar(as = As.Menu(Menu(inverted = true)))("Abc") - ReactTestUtils.withRenderedIntoDocument(sidebar) { m => - assert( - m.outerHtmlScrubbed() == """""" - ) - } - } - test("example") { - val sidebar = - <.div( - Menu( - attached = MenuAttached.Top, - compact = true, - borderless = true, - tabular = MenuTabular.Right - )( - MenuItem(as = "a")( - Icon("bars"), - "Formerly known as OT" - ) - ), - SidebarPushable(className = "maingrid")( - Sidebar( - as = As.Menu( - Menu( - inverted = true, - vertical = true, - icon = MenuIcon.Labeled - ) - ), - width = SidebarWidth.Thin, - animation = SidebarAnimation.Push, - direction = SidebarDirection.Left, - visible = true - )( - MenuItem(as = "a")(Icon("home"), "P I"), - MenuItem(as = "a")(Icon("home"), "P II") - ), - SidebarPusher(dimmed = true)( - <.div("Main") - ) - ) - ) - ReactTestUtils.withNewBodyElement { mountNode => - sidebar.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Main
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/tab/TabPaneSuite.scala b/facade/src/test/scala/react/semanticui/modules/tab/TabPaneSuite.scala new file mode 100644 index 00000000..49b08caf --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/tab/TabPaneSuite.scala @@ -0,0 +1,28 @@ +package react.semanticui.modules.tab + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class TabPaneSuite extends munit.FunSuite { + test("basic") { + val basic = TabPane("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + basic.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Abc
""" + ) + } + } + test("active") { + val basic = TabPane(active = true)("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + basic.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
Abc
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/tab/TabPaneTests.scala b/facade/src/test/scala/react/semanticui/modules/tab/TabPaneTests.scala deleted file mode 100644 index 257a19de..00000000 --- a/facade/src/test/scala/react/semanticui/modules/tab/TabPaneTests.scala +++ /dev/null @@ -1,28 +0,0 @@ -package react.semanticui.modules.tab - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object TabPaneTest extends TestSuite { - val tests = Tests { - test("basic") { - val basic = TabPane("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - basic.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Abc
""" - ) - } - } - test("active") { - val basic = TabPane(active = true)("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - basic.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
Abc
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/modules/tab/TabSuite.scala b/facade/src/test/scala/react/semanticui/modules/tab/TabSuite.scala new file mode 100644 index 00000000..dd2004d4 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/modules/tab/TabSuite.scala @@ -0,0 +1,34 @@ +package react.semanticui.modules.tab + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.semanticui.collections.menu.Menu +import react.common.syntax.vdom._ + +class TabSuite extends munit.FunSuite { + test("basic") { + val tab = Tab() + ReactTestUtils.withNewBodyElement { mountNode => + tab.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
""" + ) + } + } + test("panes") { + val tab = Tab(menu = Menu(fluid = true, vertical = true), + panes = List( + Pane(menuItem = "1", render = <.div("11")), + Pane(menuItem = "2", render = <.div("21")) + ) + ) + ReactTestUtils.withNewBodyElement { mountNode => + tab.renderIntoDOM(mountNode) + assertEquals( + mountNode.innerHTML, + """
11
""" + ) + } + } +} diff --git a/facade/src/test/scala/react/semanticui/modules/tab/TabTests.scala b/facade/src/test/scala/react/semanticui/modules/tab/TabTests.scala deleted file mode 100644 index 3eb5e996..00000000 --- a/facade/src/test/scala/react/semanticui/modules/tab/TabTests.scala +++ /dev/null @@ -1,35 +0,0 @@ -package react.semanticui.modules.tab - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ -import react.common._ -import react.semanticui.collections.menu.Menu - -object TabTest extends TestSuite { - val tests = Tests { - test("basic") { - val tab = Tab() - ReactTestUtils.withNewBodyElement { mountNode => - tab.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
""" - ) - } - } - test("panes") { - val tab = Tab(menu = Menu(fluid = true, vertical = true), - panes = List( - Pane(menuItem = "1", render = <.div("11")), - Pane(menuItem = "2", render = <.div("21")) - ) - ) - ReactTestUtils.withNewBodyElement { mountNode => - tab.renderIntoDOM(mountNode) - assert( - mountNode.innerHTML == """
11
""" - ) - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/toasts/ToastsTests.scala b/facade/src/test/scala/react/semanticui/toasts/ToastsTests.scala deleted file mode 100644 index 614ea109..00000000 --- a/facade/src/test/scala/react/semanticui/toasts/ToastsTests.scala +++ /dev/null @@ -1,19 +0,0 @@ -package react.semanticui.toasts - -import utest._ -import japgolly.scalajs.react.test._ - -object SemanticToastContainerTests extends TestSuite { - val tests = Tests { - test("render") { - val toasts = SemanticToastContainer() - ReactTestUtils.withNewBodyElement { mountNode => - toasts.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == "") - } - } - test("toast") { - toast(ToastOptions("test")) - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/card/CardContentSuite.scala b/facade/src/test/scala/react/semanticui/views/card/CardContentSuite.scala new file mode 100644 index 00000000..0d59ccdf --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/card/CardContentSuite.scala @@ -0,0 +1,16 @@ +package react.semanticui.views.card + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class CardContentSuite extends munit.FunSuite { + test("render") { + val cc = CardContent("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + cc.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/card/CardContentTests.scala b/facade/src/test/scala/react/semanticui/views/card/CardContentTests.scala deleted file mode 100644 index 84312a0c..00000000 --- a/facade/src/test/scala/react/semanticui/views/card/CardContentTests.scala +++ /dev/null @@ -1,18 +0,0 @@ -package react.semanticui.views.card - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object CardContentTests extends TestSuite { - val tests = Tests { - test("render") { - val cc = CardContent("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - cc.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert(html == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/card/CardDescriptionSuite.scala b/facade/src/test/scala/react/semanticui/views/card/CardDescriptionSuite.scala new file mode 100644 index 00000000..c488c35d --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/card/CardDescriptionSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.views.card + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class CardDescriptionSuite extends munit.FunSuite { + test("render") { + val cd = CardDescription("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + cd.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/card/CardDescriptionTests.scala b/facade/src/test/scala/react/semanticui/views/card/CardDescriptionTests.scala deleted file mode 100644 index 62bc7b72..00000000 --- a/facade/src/test/scala/react/semanticui/views/card/CardDescriptionTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.views.card - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object CardDescriptionTests extends TestSuite { - val tests = Tests { - test("render") { - val cd = CardDescription("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - cd.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/card/CardExtraSuite.scala b/facade/src/test/scala/react/semanticui/views/card/CardExtraSuite.scala new file mode 100644 index 00000000..8d4b85e9 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/card/CardExtraSuite.scala @@ -0,0 +1,16 @@ +package react.semanticui.views.card + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class CardExtraSuite extends munit.FunSuite { + test("render") { + val ce = CardExtra("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + ce.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/card/CardExtraTests.scala b/facade/src/test/scala/react/semanticui/views/card/CardExtraTests.scala deleted file mode 100644 index 0d1bdad1..00000000 --- a/facade/src/test/scala/react/semanticui/views/card/CardExtraTests.scala +++ /dev/null @@ -1,18 +0,0 @@ -package react.semanticui.views.card - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object CardExtraTests extends TestSuite { - val tests = Tests { - test("render") { - val ce = CardExtra("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - ce.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert(html == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/card/CardGroupSuite.scala b/facade/src/test/scala/react/semanticui/views/card/CardGroupSuite.scala new file mode 100644 index 00000000..cfcf9626 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/card/CardGroupSuite.scala @@ -0,0 +1,16 @@ +package react.semanticui.views.card + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class CardGroupSuite extends munit.FunSuite { + test("render") { + val cardGroup = CardGroup("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + cardGroup.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assertEquals(html, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/card/CardGroupTests.scala b/facade/src/test/scala/react/semanticui/views/card/CardGroupTests.scala deleted file mode 100644 index bf3c16a1..00000000 --- a/facade/src/test/scala/react/semanticui/views/card/CardGroupTests.scala +++ /dev/null @@ -1,18 +0,0 @@ -package react.semanticui.views.card - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object CardGroupTests extends TestSuite { - val tests = Tests { - test("render") { - val cardGroup = CardGroup("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - cardGroup.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert(html == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/card/CardHeaderSuite.scala b/facade/src/test/scala/react/semanticui/views/card/CardHeaderSuite.scala new file mode 100644 index 00000000..732cf261 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/card/CardHeaderSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.views.card + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class CardHeaderSuite extends munit.FunSuite { + test("render") { + val header = CardHeader("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/card/CardHeaderTests.scala b/facade/src/test/scala/react/semanticui/views/card/CardHeaderTests.scala deleted file mode 100644 index c2572cc9..00000000 --- a/facade/src/test/scala/react/semanticui/views/card/CardHeaderTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.views.card - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object CardHeaderTests extends TestSuite { - val tests = Tests { - test("render") { - val header = CardHeader("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/card/CardMetaSuite.scala b/facade/src/test/scala/react/semanticui/views/card/CardMetaSuite.scala new file mode 100644 index 00000000..0cb092fa --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/card/CardMetaSuite.scala @@ -0,0 +1,22 @@ +package react.semanticui.views.card + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class CardMetaSuite extends munit.FunSuite { + test("render") { + val cardMeta = CardMeta("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + cardMeta.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } + test("renderMany") { + val cardMeta = CardMeta("Abc", <.div("abc")) + ReactTestUtils.withNewBodyElement { mountNode => + cardMeta.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/card/CardMetaTests.scala b/facade/src/test/scala/react/semanticui/views/card/CardMetaTests.scala deleted file mode 100644 index d3d020ba..00000000 --- a/facade/src/test/scala/react/semanticui/views/card/CardMetaTests.scala +++ /dev/null @@ -1,24 +0,0 @@ -package react.semanticui.views.card - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object CardMetaTests extends TestSuite { - val tests = Tests { - test("render") { - val cardMeta = CardMeta("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - cardMeta.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - test("renderMany") { - val cardMeta = CardMeta("Abc", <.div("abc")) - ReactTestUtils.withNewBodyElement { mountNode => - cardMeta.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/card/CardSuite.scala b/facade/src/test/scala/react/semanticui/views/card/CardSuite.scala new file mode 100644 index 00000000..ec0ea299 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/card/CardSuite.scala @@ -0,0 +1,16 @@ +package react.semanticui.views.card + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class CardSuite extends munit.FunSuite { + test("render") { + val card = Card("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + card.renderIntoDOM(mountNode) + val html = mountNode.innerHTML + assert(html == """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/card/CardTests.scala b/facade/src/test/scala/react/semanticui/views/card/CardTests.scala deleted file mode 100644 index 8f39274e..00000000 --- a/facade/src/test/scala/react/semanticui/views/card/CardTests.scala +++ /dev/null @@ -1,18 +0,0 @@ -package react.semanticui.views.card - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object CardTests extends TestSuite { - val tests = Tests { - test("render") { - val card = Card("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - card.renderIntoDOM(mountNode) - val html = mountNode.innerHTML - assert(html == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemContentSuite.scala b/facade/src/test/scala/react/semanticui/views/item/ItemContentSuite.scala new file mode 100644 index 00000000..a0fc481d --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/item/ItemContentSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.views.item + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ItemContentSuite extends munit.FunSuite { + test("render") { + val ic = ItemContent("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + ic.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemContentTests.scala b/facade/src/test/scala/react/semanticui/views/item/ItemContentTests.scala deleted file mode 100644 index f840173b..00000000 --- a/facade/src/test/scala/react/semanticui/views/item/ItemContentTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.views.item - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ItemContentTests extends TestSuite { - val tests = Tests { - test("render") { - val ic = ItemContent("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - ic.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemDescriptionSuite.scala b/facade/src/test/scala/react/semanticui/views/item/ItemDescriptionSuite.scala new file mode 100644 index 00000000..d8fcc370 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/item/ItemDescriptionSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.views.item + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ItemDescriptionSuite extends munit.FunSuite { + test("render") { + val id = ItemDescription("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + id.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemDescriptionTests.scala b/facade/src/test/scala/react/semanticui/views/item/ItemDescriptionTests.scala deleted file mode 100644 index 74e1e576..00000000 --- a/facade/src/test/scala/react/semanticui/views/item/ItemDescriptionTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.views.item - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ItemDescriptionTests extends TestSuite { - val tests = Tests { - test("render") { - val id = ItemDescription("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - id.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemExtraSuite.scala b/facade/src/test/scala/react/semanticui/views/item/ItemExtraSuite.scala new file mode 100644 index 00000000..74911527 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/item/ItemExtraSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.views.item + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ItemExtraSuite extends munit.FunSuite { + test("render") { + val ie = ItemExtra("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + ie.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemExtraTests.scala b/facade/src/test/scala/react/semanticui/views/item/ItemExtraTests.scala deleted file mode 100644 index f03549dd..00000000 --- a/facade/src/test/scala/react/semanticui/views/item/ItemExtraTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.views.item - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ItemExtraTests extends TestSuite { - val tests = Tests { - test("render") { - val ie = ItemExtra("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - ie.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemGroupSuite.scala b/facade/src/test/scala/react/semanticui/views/item/ItemGroupSuite.scala new file mode 100644 index 00000000..d3f8cf90 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/item/ItemGroupSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.views.item + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ItemGroupSuite extends munit.FunSuite { + test("render") { + val itemGroup = ItemGroup("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + itemGroup.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemGroupTests.scala b/facade/src/test/scala/react/semanticui/views/item/ItemGroupTests.scala deleted file mode 100644 index 83eb419e..00000000 --- a/facade/src/test/scala/react/semanticui/views/item/ItemGroupTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.views.item - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ItemGroupTests extends TestSuite { - val tests = Tests { - test("render") { - val itemGroup = ItemGroup("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - itemGroup.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemHeaderSuite.scala b/facade/src/test/scala/react/semanticui/views/item/ItemHeaderSuite.scala new file mode 100644 index 00000000..e63d4bc6 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/item/ItemHeaderSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.views.item + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ItemHeaderSuite extends munit.FunSuite { + test("render") { + val header = ItemHeader("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemHeaderTests.scala b/facade/src/test/scala/react/semanticui/views/item/ItemHeaderTests.scala deleted file mode 100644 index 76449f94..00000000 --- a/facade/src/test/scala/react/semanticui/views/item/ItemHeaderTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.views.item - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ItemHeaderTests extends TestSuite { - val tests = Tests { - test("render") { - val header = ItemHeader("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemImageSuite.scala b/facade/src/test/scala/react/semanticui/views/item/ItemImageSuite.scala new file mode 100644 index 00000000..2f53a99d --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/item/ItemImageSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.views.item + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ItemImageSuite extends munit.FunSuite { + test("render") { + val header = ItemImage(src = "Abc") + ReactTestUtils.withNewBodyElement { mountNode => + header.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemImageTests.scala b/facade/src/test/scala/react/semanticui/views/item/ItemImageTests.scala deleted file mode 100644 index 56a6aced..00000000 --- a/facade/src/test/scala/react/semanticui/views/item/ItemImageTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.views.item - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ItemImageTests extends TestSuite { - val tests = Tests { - test("render") { - val header = ItemImage(src = "Abc") - ReactTestUtils.withNewBodyElement { mountNode => - header.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemMetaSuite.scala b/facade/src/test/scala/react/semanticui/views/item/ItemMetaSuite.scala new file mode 100644 index 00000000..6f0bc9f7 --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/item/ItemMetaSuite.scala @@ -0,0 +1,22 @@ +package react.semanticui.views.item + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ItemMetaSuite extends munit.FunSuite { + test("render") { + val itemMeta = ItemMeta("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + itemMeta.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } + test("renderMany") { + val itemMeta = ItemMeta("Abc", <.div("abc")) + ReactTestUtils.withNewBodyElement { mountNode => + itemMeta.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemMetaTests.scala b/facade/src/test/scala/react/semanticui/views/item/ItemMetaTests.scala deleted file mode 100644 index 8cddaafb..00000000 --- a/facade/src/test/scala/react/semanticui/views/item/ItemMetaTests.scala +++ /dev/null @@ -1,24 +0,0 @@ -package react.semanticui.views.item - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ItemMetaTests extends TestSuite { - val tests = Tests { - test("render") { - val itemMeta = ItemMeta("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - itemMeta.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - test("renderMany") { - val itemMeta = ItemMeta("Abc", <.div("abc")) - ReactTestUtils.withNewBodyElement { mountNode => - itemMeta.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
abc
""") - } - } - } -} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemSuite.scala b/facade/src/test/scala/react/semanticui/views/item/ItemSuite.scala new file mode 100644 index 00000000..47d8a03c --- /dev/null +++ b/facade/src/test/scala/react/semanticui/views/item/ItemSuite.scala @@ -0,0 +1,15 @@ +package react.semanticui.views.item + +import japgolly.scalajs.react.test._ +import japgolly.scalajs.react.vdom.html_<^._ +import react.common.syntax.vdom._ + +class ItemSuite extends munit.FunSuite { + test("render") { + val item = Item("Abc") + ReactTestUtils.withNewBodyElement { mountNode => + item.renderIntoDOM(mountNode) + assertEquals(mountNode.innerHTML, """
Abc
""") + } + } +} diff --git a/facade/src/test/scala/react/semanticui/views/item/ItemTests.scala b/facade/src/test/scala/react/semanticui/views/item/ItemTests.scala deleted file mode 100644 index ef4d0767..00000000 --- a/facade/src/test/scala/react/semanticui/views/item/ItemTests.scala +++ /dev/null @@ -1,17 +0,0 @@ -package react.semanticui.views.item - -import utest._ -import japgolly.scalajs.react.test._ -import japgolly.scalajs.react.vdom.html_<^._ - -object ItemTests extends TestSuite { - val tests = Tests { - test("render") { - val item = Item("Abc") - ReactTestUtils.withNewBodyElement { mountNode => - item.renderIntoDOM(mountNode) - assert(mountNode.innerHTML == """
Abc
""") - } - } - } -}