e2e

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Code    int
	Message string
}

APIError represents an API error state

type CapturedNotification

type CapturedNotification struct {
	Title string
	Body  string
	URL   string
	Time  time.Time
}

CapturedNotification represents a captured notification

type MockComment

type MockComment struct {
	Author    string
	Body      string
	CreatedAt time.Time
	Reactions []MockReaction
}

MockComment represents a comment

type MockCommit

type MockCommit struct {
	SHA           string
	Author        string
	CommittedDate time.Time
}

MockCommit represents a commit

type MockGitHubServer

type MockGitHubServer struct {
	*httptest.Server
	// contains filtered or unexported fields
}

MockGitHubServer simulates GitHub GraphQL API for E2E tests

func SetupMockGitHubServer

func SetupMockGitHubServer() *MockGitHubServer

SetupMockGitHubServer creates a new mock GitHub server

func (*MockGitHubServer) AddComment

func (m *MockGitHubServer) AddComment(prNumber int, comment MockComment)

AddComment adds a comment to a PR

func (*MockGitHubServer) AddCommit

func (m *MockGitHubServer) AddCommit(prNumber int, commit MockCommit)

AddCommit adds a commit to a PR

func (*MockGitHubServer) AddReactionToComment

func (m *MockGitHubServer) AddReactionToComment(prNumber int, commentIndex int, reaction MockReaction)

AddReactionToComment adds a reaction to an existing comment

func (*MockGitHubServer) AddReactionToReview

func (m *MockGitHubServer) AddReactionToReview(prNumber int, reviewIndex int, reaction MockReaction)

AddReactionToReview adds a reaction to an existing review

func (*MockGitHubServer) AddReview

func (m *MockGitHubServer) AddReview(prNumber int, review MockReview)

AddReview adds a review to a PR

func (*MockGitHubServer) ClearError

func (m *MockGitHubServer) ClearError()

ClearError clears the error state

func (*MockGitHubServer) ClosePR

func (m *MockGitHubServer) ClosePR(prNumber int)

ClosePR marks a PR as closed

func (*MockGitHubServer) MergePR

func (m *MockGitHubServer) MergePR(prNumber int)

MergePR marks a PR as merged

func (*MockGitHubServer) SetError

func (m *MockGitHubServer) SetError(code int, message string)

SetError sets an error state for the server

func (*MockGitHubServer) SetLatestReviews

func (m *MockGitHubServer) SetLatestReviews(prNumber int, reviews []MockLatestReview)

SetLatestReviews sets the latest reviews for a PR (returned in search query's latestReviews connection). This is separate from AddReview (which is used for timeline/activity tracking). Each call replaces the full set of latest reviews for the PR.

func (*MockGitHubServer) SetPipelineStatus

func (m *MockGitHubServer) SetPipelineStatus(prNumber int, state string)

SetPipelineStatus sets the statusCheckRollup state for a PR. Use GitHub rollup state strings: SUCCESS, FAILURE, PENDING, IN_PROGRESS, ERROR, CANCELLED.

func (*MockGitHubServer) SetupPRs

func (m *MockGitHubServer) SetupPRs(prs []MockPR)

SetupPRs configures the mock server with PRs

type MockLatestReview

type MockLatestReview struct {
	Author      string
	State       string // APPROVED, CHANGES_REQUESTED, COMMENTED, DISMISSED
	SubmittedAt time.Time
}

MockLatestReview represents a review returned in the search query's latestReviews connection

type MockPR

type MockPR struct {
	Title                string
	URL                  string
	Number               int
	CreatedAt            time.Time
	IsDraft              bool
	State                string
	Repository           string
	Author               string
	HeadCommitSHA        string
	PipelineStatus       string // GitHub statusCheckRollup state: SUCCESS, FAILURE, PENDING, IN_PROGRESS, etc.
	AppearInReviewSearch bool   // Force this PR to appear in review-requested/reviewed-by results too
}

MockPR represents a pull request in the mock server

type MockReaction

type MockReaction struct {
	Content   string // e.g., "THUMBS_UP", "HEART", "LAUGH"
	User      string // Username who reacted
	CreatedAt time.Time
}

MockReaction represents a reaction emoji

type MockReview

type MockReview struct {
	Author    string
	State     string
	Body      string
	CreatedAt time.Time
	Reactions []MockReaction
}

MockReview represents a review

type SpyNotificationAdapter

type SpyNotificationAdapter struct {
	// contains filtered or unexported fields
}

SpyNotificationAdapter captures notifications for testing

func NewSpyNotificationAdapter

func NewSpyNotificationAdapter() *SpyNotificationAdapter

NewSpyNotificationAdapter creates a new spy adapter

func (*SpyNotificationAdapter) Clear

func (s *SpyNotificationAdapter) Clear()

Clear clears captured notifications

func (*SpyNotificationAdapter) GetNotifications

func (s *SpyNotificationAdapter) GetNotifications() []CapturedNotification

GetNotifications returns all captured notifications

func (*SpyNotificationAdapter) NotifyMessage

func (s *SpyNotificationAdapter) NotifyMessage(title, message string) error

NotifyMessage captures a simple text notification (implements NotificationPort)

func (*SpyNotificationAdapter) NotifyPullRequests

func (s *SpyNotificationAdapter) NotifyPullRequests(notifications []*port.PRNotificationData) error

NotifyPullRequests captures the notification (implements NotificationPort)

func (*SpyNotificationAdapter) SupportsClickActions

func (s *SpyNotificationAdapter) SupportsClickActions() bool

SupportsClickActions returns true

type SpyUIAdapter

type SpyUIAdapter struct {
	// contains filtered or unexported fields
}

SpyUIAdapter captures menu updates for testing

func NewSpyUIAdapter

func NewSpyUIAdapter() *SpyUIAdapter

NewSpyUIAdapter creates a new spy UI adapter

func (*SpyUIAdapter) GetPRs

func (s *SpyUIAdapter) GetPRs() []*pullrequest.PullRequest

GetPRs returns captured PRs

func (*SpyUIAdapter) GetUpdateCount

func (s *SpyUIAdapter) GetUpdateCount() int

GetUpdateCount returns the number of updates

func (*SpyUIAdapter) UpdateDisplay

func (s *SpyUIAdapter) UpdateDisplay(requestedPRs, userPRs []*pullrequest.PullRequest, _ pullrequest.PRTrackingRepository)

UpdateDisplay captures the PRs (implements UIPort)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL