(t *TestDriver, keys config.KeybindingConfig)
| 76 | } |
| 77 | |
| 78 | func 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 | } |
no test coverage detected