mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
fix(keys): spacebar now sends a KeySpace (#289)
* fix: replace keySP with working KeySpace * test: update test to meet new reqs * fix: fix test looking for 'space' * fix(keys): set type to KeySpace when sending a space * docs(keys): comments Co-authored-by: Christian Rocha <christian@rocha.is>
This commit is contained in:
10
key_test.go
10
key_test.go
@@ -8,10 +8,10 @@ import (
|
||||
func TestKeyString(t *testing.T) {
|
||||
t.Run("alt+space", func(t *testing.T) {
|
||||
if got := KeyMsg(Key{
|
||||
Type: keySP,
|
||||
Type: KeySpace,
|
||||
Alt: true,
|
||||
}).String(); got != "alt+space" {
|
||||
t.Fatalf(`expected a "alt+space", got %q`, got)
|
||||
}).String(); got != "alt+ " {
|
||||
t.Fatalf(`expected a "alt+ ", got %q`, got)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -35,8 +35,8 @@ func TestKeyString(t *testing.T) {
|
||||
|
||||
func TestKeyTypeString(t *testing.T) {
|
||||
t.Run("space", func(t *testing.T) {
|
||||
if got := keySP.String(); got != "space" {
|
||||
t.Fatalf(`expected a "space", got %q`, got)
|
||||
if got := KeySpace.String(); got != " " {
|
||||
t.Fatalf(`expected a " ", got %q`, got)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user