I am working with scala-js, and I am trying to write a WordSpec test for the very first thing that runs, setting up the ui. Currently I have
"An HTML Document" when {
"setupUI() is called" should {
"contain a style element" in {
assert(jQuery("style").length >= 1)
}
}
}
This is great, however, I also want to make sure that said style element has its "id" field set properly. What I would think to do is
"An HTML Document" when {
"setupUI() is called" should {
"contain a style element" in {
assert(jQuery("style").length >= 1)
}
which should "have its id set" in {
assert(!jQuery("style")(0).id.isEmpty())
}
}
}
The problem is that there is no "which" keyword.
What is the proper way to do something like this? It almost seems like I should have another when>should>in block for the style element, but that seems redundant.