Fixed unit test.

This commit is contained in:
Daan Vanden Bosch 2021-04-15 21:50:52 +02:00
parent 5133235040
commit bc660b23e9
2 changed files with 3 additions and 3 deletions

View File

@ -39,12 +39,12 @@ class QuestEditorToolbarController(
) : Controller() {
private val _resultDialogVisible = mutableVal(false)
private val _result = mutableVal<PwResult<*>?>(null)
private val _saveAsDialogVisible = mutableVal(false)
private val saving = mutableVal(false)
// We mainly disable saving while a save is underway for visual feedback that a save is
// happening/has happened.
private val savingEnabled = questEditorStore.currentQuest.isNotNull() and !saving
private val _saveAsDialogVisible = mutableVal(false)
private val files: MutableListVal<FileHandle> = mutableListVal()
private val _filename = mutableVal("")
private val _version = mutableVal(Version.BB)
@ -61,7 +61,7 @@ class QuestEditorToolbarController(
),
)
// Save as
// Saving
val saveEnabled: Val<Boolean> =
savingEnabled and files.notEmpty and BrowserFeatures.fileSystemApi

View File

@ -36,7 +36,7 @@ class QuestEditorToolbarControllerTests : WebTestSuite {
assertNull(ctrl.result.value)
ctrl.openFiles(listOf(FileHandle(File(arrayOf(), "unknown.extension"))))
ctrl.openFiles(listOf(FileHandle.Simple(File(arrayOf(), "unknown.extension"))))
val result = ctrl.result.value