mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-26 05:37:18 +02:00
54776052a1
If the command used by OSCommand.OpenLink fails, lazygit crashes. With this change, if the OpenLink command fails, lazygit just shows a dialog inviting the user to visit the relevant URL. Fixes #2882
25 lines
715 B
Go
25 lines
715 B
Go
package ui
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
var OpenLinkFailure = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "When opening links via the OS fails, show a dialog instead.",
|
|
ExtraCmdArgs: []string{},
|
|
Skip: false,
|
|
SetupConfig: func(config *config.AppConfig) {
|
|
config.UserConfig.OS.OpenLink = "exit 42"
|
|
},
|
|
SetupRepo: func(shell *Shell) {},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.Views().Information().Click(0, 0)
|
|
|
|
t.ExpectPopup().Confirmation().
|
|
Title(Equals("Donate")).
|
|
Content(Equals("Please go to https://github.com/sponsors/jesseduffield")).
|
|
Confirm()
|
|
},
|
|
})
|