-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Improve staging panel integration tests #2474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| continue | ||
| } | ||
|
|
||
| if lineIdx == len(lines)-1 && line == "" { // skip the trailing newline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that you can actually select past the bottom of the patch thank to a trailing newline that we treat as a separate line in its own right. I've got a couple of changes in this PR that trim that trailing newline, and from all my testing it seems like a safe change. We still ensure that upon copying the patch to the clipboard it's got a trailing newline in it.
| name: fmt.Sprintf("contains '%s'", target), | ||
| testFn: func(value string) (bool, string) { | ||
| // everything contains the empty string so we unconditionally return true here | ||
| if target == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no idea why this code was needed: I thought strings.Contains would do the job properly but apparently not
| func (self *TestDriver) navigateToListItem(matcher *matcher) { | ||
| self.inListContext() | ||
|
|
||
| currentContext := self.gui.CurrentContext().(types.IListContext) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
turns out it doesn't matter if we're in a list item or not. I'll update this function to be called navigateToLine in a separate PR
Uffizzi Preview Environment
|
| return self | ||
| } | ||
|
|
||
| func (self *ViewDriver) ContainsLines(matchers ...*matcher) *ViewDriver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we have Lines, TopLines, ContainsLines, and SelectedLines. We'll need to update the naming so they're all consistent e.g. AllLines, TopLines, SomeLines, and SelectedLines. Something like that. I'll do that in another PR
| } | ||
|
|
||
| func (self *Views) byName(viewName string) *ViewDriver { | ||
| func (self *Views) regularView(viewName string) *ViewDriver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really happy with the name here but needed to distinguish from a view driver that had its own special getSelectedLines function
|
|
||
| // expected to only be used in tests | ||
| func (v *View) SelectedLine() string { | ||
| v.writeMutex.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had some race conditions happening here
37e67f3 to
707ad03
Compare
707ad03 to
db011d8
Compare
I'm gonna have a separate PR which updates some method names to make things more consistent.
go run scripts/cheatsheet/main.go generate)docs/Config.md) have been updated if necessary