-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- text area handler getting replaced beacuse it reported itself as inactive - using wrong pHandleMouse of TextAreaHandler in non-creation case - add UTs for TextArea
- Loading branch information
1 parent
834ec91
commit 6695bc0
Showing
8 changed files
with
81 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{-# LANGUAGE RecordWildCards #-} | ||
{-# LANGUAGE RecursiveDo #-} | ||
|
||
module Potato.Flow.Controller.Manipulator.TextAreaSpec ( | ||
spec | ||
) where | ||
|
||
import Relude hiding (empty, | ||
fromList) | ||
|
||
import Test.Hspec | ||
|
||
import Potato.Flow | ||
import Potato.Flow.GoatTester | ||
import Potato.Flow.Controller.Manipulator.TestHelpers | ||
|
||
|
||
import qualified Data.Sequence as Seq | ||
|
||
|
||
|
||
|
||
|
||
basic_test :: Spec | ||
basic_test = hSpecGoatTesterWithOwlPFState (emptyOwlStateWithSize (100,100)) $ do | ||
|
||
setMarker "create a TextArea" | ||
setTool Tool_TextArea | ||
canvasMouseDown (0, 0) | ||
canvasMouseDownUp (50, 50) | ||
verifyOwlCount 1 | ||
|
||
setMarker "add some text" | ||
pressKeys "poop" | ||
verifyRenderNonEmptyCount 4 | ||
verifyCharRenderedAt (V2 0 0) (Just 'p') | ||
|
||
|
||
setMarker "deselect then reselect" | ||
verifyCanvasHandler handlerName_textArea | ||
pressEscape | ||
verifyCanvasHandler handlerName_box | ||
pressEscape | ||
canvasMouseDownUp (25, 25) | ||
|
||
setMarker "move cursor" | ||
canvasMouseDownUp (0, 1) | ||
pressKeys "meow" | ||
verifyRenderNonEmptyCount 8 | ||
verifyCharRenderedAt (V2 3 1) (Just 'w') | ||
|
||
|
||
|
||
|
||
spec :: Spec | ||
spec = do | ||
describe "TextArea" $ do | ||
describe "basic_test" $ basic_test | ||
|
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