1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 11:02:41 +03:00

Add integration test for commit highlighting on focus

A better refactor would be to allow matchers to assert against either a string or a slice of cells, so that I could have
the same ergonomics that I have elsewhere, but this is a start.
This commit is contained in:
Jesse Duffield
2023-06-01 20:11:06 +10:00
parent 5df27c61ed
commit 4ff02bd3b7
94 changed files with 408 additions and 675 deletions

View File

@@ -0,0 +1,37 @@
package commit
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var Highlight = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Verify that the commit view highlights the correct lines",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().Git.Log.ShowGraph = "always"
config.GetUserConfig().Gui.AuthorColors = map[string]string{
"CI": "red",
}
},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("one")
shell.EmptyCommit("two")
shell.EmptyCommit("three")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
highlightedColor := "#ffffff"
t.Views().Commits().
DoesNotContainColoredText(highlightedColor, "◯").
Focus().
ContainsColoredText(highlightedColor, "◯")
t.Views().Files().
Focus()
t.Views().Commits().
DoesNotContainColoredText(highlightedColor, "◯")
},
})