-
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.
- Loading branch information
1 parent
15a71a5
commit 98bb638
Showing
32 changed files
with
235 additions
and
91 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
46 changes: 46 additions & 0 deletions
46
app-tests/src/test/scala/app/logorrr/usecases/textview/SimpleTextSizeTest.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,46 @@ | ||
package app.logorrr.usecases.textview | ||
|
||
import app.logorrr.TestFiles | ||
import app.logorrr.conf.{LogoRRRGlobals, Settings, StageSettings} | ||
import app.logorrr.io.FileId | ||
import app.logorrr.services.LogoRRRServices | ||
import app.logorrr.services.fileservices.OpenSingleFileService | ||
import app.logorrr.services.hostservices.MockHostServices | ||
import app.logorrr.usecases.SingleFileApplicationTest | ||
import app.logorrr.views.text.toolbaractions.{DecreaseTextSizeButton, IncreaseTextSizeButton} | ||
import org.junit.jupiter.api.Test | ||
|
||
class SimpleTextSizeTest extends SingleFileApplicationTest(TestFiles.simpleLog0) { | ||
|
||
override val services = LogoRRRServices(Settings.Default.copy(stageSettings = StageSettings(100, 100, 1200, 600)) | ||
, new MockHostServices | ||
, new OpenSingleFileService(Option(path)) | ||
, isUnderTest = true) | ||
|
||
@Test def search(): Unit = { | ||
openFile(path) | ||
val fileId = FileId(path) | ||
|
||
val size = LogoRRRGlobals.getLogFileSettings(fileId).getFontSize | ||
val count = 10 | ||
|
||
for (_ <- 1 to count) increaseTextSize(fileId) | ||
assert(size + count == LogoRRRGlobals.getLogFileSettings(fileId).getFontSize) | ||
|
||
// decrease again | ||
for (_ <- 1 to 10) decreaseTextSize(fileId) | ||
assert(size == LogoRRRGlobals.getLogFileSettings(fileId).getFontSize) | ||
} | ||
|
||
|
||
private def increaseTextSize(fileId: FileId): Unit = { | ||
waitForVisibility(IncreaseTextSizeButton.uiNode(fileId)) | ||
clickOn(IncreaseTextSizeButton.uiNode(fileId)) | ||
} | ||
|
||
private def decreaseTextSize(fileId: FileId): Unit = { | ||
waitForVisibility(DecreaseTextSizeButton.uiNode(fileId)) | ||
clickOn(DecreaseTextSizeButton.uiNode(fileId)) | ||
} | ||
|
||
} |
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
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
package app.logorrr.services | ||
|
||
import app.logorrr.conf.Settings | ||
import app.logorrr.services.fileservices.LogoRRRFileOpenService | ||
import app.logorrr.services.hostservices.LogoRRRHostServices | ||
|
||
case class LogoRRRServices(hostServices: LogoRRRHostServices | ||
case class LogoRRRServices(settings: Settings | ||
, hostServices: LogoRRRHostServices | ||
, fileOpenService: LogoRRRFileOpenService | ||
, isUnderTest: Boolean) |
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,9 @@ | ||
package app.logorrr.views | ||
|
||
import app.logorrr.io.FileId | ||
|
||
trait UiNodeAware { | ||
|
||
def uiNode(id: FileId): UiNode | ||
|
||
} |
14 changes: 7 additions & 7 deletions
14
...cala/app/logorrr/views/LogoRRRNodes.scala → ...ain/scala/app/logorrr/views/UiNodes.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
Oops, something went wrong.