-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from rladstaetter/218-if-you-drop-a-directory…
…-with-zip-files-those-should-be-unpacked-and-displayed #218: opens zip files in dropped directory
- Loading branch information
Showing
2 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
app-tests/src/test/scala/app/logorrr/usecases/dnd/DndDropDirectoryTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package app.logorrr.usecases.dnd | ||
|
||
import app.logorrr.io.FileId | ||
import app.logorrr.steps.{CheckTabPaneActions, VisibleItemActions} | ||
import app.logorrr.usecases.StartEmptyApplicationTest | ||
import app.logorrr.views.UiNodes | ||
import app.logorrr.{LogoRRRApp, TestFiles} | ||
import javafx.scene.Scene | ||
import javafx.scene.control.ToolBar | ||
import javafx.scene.input.MouseButton | ||
import javafx.stage.Stage | ||
import org.junit.jupiter.api.{BeforeAll, Test} | ||
|
||
object DndDropDirectoryTest { | ||
|
||
@BeforeAll | ||
def setUp(): Unit = { | ||
// necessary for https://github.com/TestFX/TestFX/issues/33 | ||
System.setProperty("testfx.robot", "awt") | ||
} | ||
|
||
} | ||
|
||
class DndDropDirectoryTest extends StartEmptyApplicationTest | ||
with VisibleItemActions | ||
with CheckTabPaneActions { | ||
|
||
@throws[Exception] | ||
override def start(stage: Stage): Unit = { | ||
LogoRRRApp.start(stage, services) | ||
stage.toFront() | ||
|
||
val dndStage = new Stage() | ||
val dropBox = new ToolBar(Seq(new DragSourceButton(TestFiles.baseDir)): _*) | ||
dndStage.setScene(new Scene(dropBox)) | ||
dndStage.show() | ||
|
||
} | ||
|
||
@Test def testOpeningDirectoryWith5FilesAndAZipContaining10Files(): Unit = { | ||
checkForEmptyTabPane() | ||
drag(DragSourceButton.uiNode(FileId(TestFiles.baseDir)).ref, MouseButton.PRIMARY).dropTo(UiNodes.MainTabPane.ref) | ||
expectCountOfOpenFiles(15) | ||
} | ||
|
||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters