MCPcopy
hub / github.com/jesseduffield/lazygit / checkBlockingHook

Function checkBlockingHook

pkg/integration/tests/commit/shared.go:78–111  ·  view source on GitHub ↗
(t *TestDriver, keys config.KeybindingConfig)

Source from the content-addressed store, hash-verified

76}
77
78func checkBlockingHook(t *TestDriver, keys config.KeybindingConfig) {
79 // Shared function for tests using the blockingHook pre-commit hook for testing hook skipping
80 // Stage first file
81 t.Views().Files().
82 IsFocused().
83 PressPrimaryAction().
84 Press(keys.Files.CommitChanges)
85
86 // Try to commit with hook
87 t.ExpectPopup().CommitMessagePanel().
88 Title(Equals("Commit summary")).
89 Type("Commit should fail").
90 Confirm()
91
92 t.ExpectPopup().Alert().
93 Title(Equals("Error")).
94 Content(Contains("Git command failed.")).
95 Confirm()
96
97 // Clear the message
98 t.Views().Files().
99 IsFocused().
100 Press(keys.Files.CommitChanges)
101
102 t.ExpectPopup().CommitMessagePanel().
103 Title(Equals("Commit summary")).
104 Clear().
105 Cancel()
106
107 // Unstage the file
108 t.Views().Files().
109 IsFocused().
110 PressPrimaryAction()
111}

Calls 15

EqualsFunction · 0.85
ContainsFunction · 0.85
PressMethod · 0.80
PressPrimaryActionMethod · 0.80
IsFocusedMethod · 0.80
FilesMethod · 0.80
CommitMessagePanelMethod · 0.80
ExpectPopupMethod · 0.80
ViewsMethod · 0.65
ConfirmMethod · 0.65
TitleMethod · 0.65
AlertMethod · 0.65

Tested by

no test coverage detected