소스 검색

Updates a test for the tui

arianagiroux 2 주 전
부모
커밋
42749a7a93
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      tui.go
  2. 1 1
      tui_test.go

+ 1 - 1
tui.go

@@ -71,7 +71,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 	// widget specifc keyhandling
 	var cmds []tea.Cmd
 	switch m.widget.(type) {
-	case IssueCollection:
+	case IssueCollection: // TODO handle updates to IssueCollection widgets in its own update func
 		if msg, ok := msg.(tea.KeyMsg); ok {
 			switch msg.String() {
 			case "j":

+ 1 - 1
tui_test.go

@@ -20,7 +20,7 @@ func Test_Model_Init(t *testing.T) {
 
 func Test_Model_Update_quit_on_keymsg(t *testing.T) {
 	testModel := Model{}
-	testKey := tea.Key{Type: tea.KeyRunes, Runes: []rune{'q'}}
+	testKey := tea.Key{Type: tea.KeyCtrlC}
 	testMsg := tea.KeyMsg(testKey)
 
 	model, cmd := testModel.Update(testMsg)