1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-10 11:10:18 +02:00
lazygit/pkg/integration/tests/branch/reset_upstream.go
Jesse Duffield d772c9f1d4 Use sentence case everywhere
We have not been good at consistent casing so far. Now we use 'Sentence case' everywhere. EVERYWHERE.

Also Removing 'Lc' prefix from i18n field names: the 'Lc' stood for lowercase but now that everything
is in 'Sentence case' there's no need for the distinction.

I've got a couple lower case things I've kept: namely, things that show up in parentheses.
2023-05-25 23:52:19 +10:00

37 lines
1.0 KiB
Go

package branch
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var ResetUpstream = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Reset the upstream of a branch",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("one")
shell.CloneIntoRemote("origin")
shell.SetBranchUpstream("master", "origin/master")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Branches().
Focus().
Press(keys.Universal.NextScreenMode). // we need to enlargen the window to see the upstream
Lines(
Contains("master").Contains("origin master").IsSelected(),
).
Press(keys.Branches.SetUpstream).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Set/Unset upstream")).
Select(Contains("Unset upstream of selected branch")).
Confirm()
}).
Lines(
Contains("master").DoesNotContain("origin master").IsSelected(),
)
},
})