* deletion for issues with confirmation flag
* add handling for interaction case
* finish implementation for issues
* finish the implementation for issues
* finalize the implementation for PR
* fix missing --yes flag for PR
* address PR comments related to feedbacks
* improve CommentablePreRun for pre checks
* improve confirmation prompt and truncate long comment body
* address PR comments on tests
* Truncate comment for confirmation prompt
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* Improve test case descriptions
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* Fix mock comment body
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* Remove irrelevant prompt stub
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* Use `opts.Interactive` as TTY indicator
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* Fix expected `Interactive` value
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* Polish `TestNewCmdComment`
Signed-off-by: Babak K. Shandiz <babakks@github.com>
---------
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Co-authored-by: Babak K. Shandiz <babakks@github.com>
This commit brings the `gh issue comment` and `gh pr comment` tests in line with one another while also addressing some corner cases that weren't previously tested.
There is still a bit of work to get the gh pr comment tests in order, however this goes a way towards fixing the issue along with acceptance tests.
Also, it turns out some of the issue acceptance tests were really running `pr` tests.
The "Author" struct was too overloaded in different types of queries that treat struct fields in incompatible ways. This change defines a simpler CommentAuthor struct for use in comments until we can figure out how to query `... on User` information for comments too.
- `issue comment` no longer fetches all issue fields and thus avoids the
problem when loading failed due to token not having access to projects
- `issue comment` now accepts either issue or pull number as argument.
This removes sensitivity to the BROWSER environment variable in tests
and makes it easier to verify the URL that the browser was invoked with
without having to stub sub-processes.