mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-08 23:57:41 +00:00
disable undo-like functionality for textInput, fixes #1019
This commit is contained in:
parent
73988394a9
commit
f2a46cfa9a
2 changed files with 35 additions and 1 deletions
|
@ -613,6 +613,35 @@ class InputLogicTest {
|
|||
assertEquals("{\"label\": \"c", text)
|
||||
}
|
||||
|
||||
@Test fun `text input and delete`() {
|
||||
reset()
|
||||
input("hello")
|
||||
assertEquals("hello", text)
|
||||
functionalKeyPress(KeyCode.DELETE)
|
||||
assertEquals("hell", text)
|
||||
|
||||
reset()
|
||||
input("hello ")
|
||||
assertEquals("hello ", text)
|
||||
functionalKeyPress(KeyCode.DELETE)
|
||||
assertEquals("hello", text)
|
||||
}
|
||||
|
||||
@Test fun `emoji text input and delete`() {
|
||||
reset()
|
||||
input("🕵🏼")
|
||||
functionalKeyPress(KeyCode.DELETE)
|
||||
assertEquals("", text)
|
||||
|
||||
reset()
|
||||
input("\uD83D\uDD75\uD83C\uDFFC")
|
||||
input(' ')
|
||||
assertEquals("🕵🏼 ", text)
|
||||
functionalKeyPress(KeyCode.DELETE)
|
||||
functionalKeyPress(KeyCode.DELETE)
|
||||
assertEquals("", text)
|
||||
}
|
||||
|
||||
// ------- helper functions ---------
|
||||
|
||||
// should be called before every test, so the same state is guaranteed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue