Fix tests failing due to missing screen during attempted window dismissal

This commit is contained in:
Shadowfacts 2019-06-27 19:29:29 -04:00
parent e92bcd81cb
commit ed3d2d3621
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
3 changed files with 12 additions and 3 deletions

View File

@ -1,5 +1,6 @@
package net.shadowfacts.cacao.view package net.shadowfacts.cacao.view
import net.shadowfacts.cacao.CacaoScreen
import net.shadowfacts.cacao.Window import net.shadowfacts.cacao.Window
import net.shadowfacts.cacao.geometry.Point import net.shadowfacts.cacao.geometry.Point
import net.shadowfacts.cacao.geometry.Rect import net.shadowfacts.cacao.geometry.Rect
@ -14,11 +15,13 @@ import java.util.concurrent.CompletableFuture
*/ */
class ViewClickTests { class ViewClickTests {
lateinit var screen: CacaoScreen
lateinit var window: Window lateinit var window: Window
@BeforeEach @BeforeEach
fun setup() { fun setup() {
window = Window() screen = CacaoScreen()
window = screen.addWindow(Window())
} }
@Test @Test

View File

@ -1,5 +1,6 @@
package net.shadowfacts.cacao.view.button package net.shadowfacts.cacao.view.button
import net.shadowfacts.cacao.CacaoScreen
import net.shadowfacts.cacao.Window import net.shadowfacts.cacao.Window
import net.shadowfacts.cacao.geometry.Point import net.shadowfacts.cacao.geometry.Point
import net.shadowfacts.cacao.geometry.Size import net.shadowfacts.cacao.geometry.Size
@ -17,11 +18,13 @@ import java.util.concurrent.CompletableFuture
*/ */
class ButtonClickTests { class ButtonClickTests {
lateinit var screen: CacaoScreen
lateinit var window: Window lateinit var window: Window
@BeforeEach @BeforeEach
fun setup() { fun setup() {
window = Window() screen = CacaoScreen()
window = screen.addWindow(Window())
} }
@Test @Test

View File

@ -1,5 +1,6 @@
package net.shadowfacts.cacao.view.button package net.shadowfacts.cacao.view.button
import net.shadowfacts.cacao.CacaoScreen
import net.shadowfacts.cacao.Window import net.shadowfacts.cacao.Window
import net.shadowfacts.cacao.geometry.Point import net.shadowfacts.cacao.geometry.Point
import net.shadowfacts.cacao.geometry.Rect import net.shadowfacts.cacao.geometry.Rect
@ -28,11 +29,13 @@ class EnumButtonTests {
ONE, TWO, THREE ONE, TWO, THREE
} }
lateinit var screen: CacaoScreen
lateinit var window: Window lateinit var window: Window
@BeforeEach @BeforeEach
fun setup() { fun setup() {
window = Window() screen = CacaoScreen()
window = screen.addWindow(Window())
} }
@Test @Test