-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71d2fd3
commit d41a195
Showing
6 changed files
with
137 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package tag | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
var ForceTagAnnotated = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Overwrite an annotated tag that already exists", | ||
ExtraCmdArgs: []string{}, | ||
Skip: false, | ||
SetupConfig: func(config *config.AppConfig) {}, | ||
SetupRepo: func(shell *Shell) { | ||
shell.EmptyCommit("first commit") | ||
shell.CreateAnnotatedTag("new-tag", "message", "HEAD") | ||
shell.EmptyCommit("second commit") | ||
}, | ||
Run: func(t *TestDriver, keys config.KeybindingConfig) { | ||
t.Views().Commits(). | ||
Focus(). | ||
Lines( | ||
Contains("second commit").IsSelected(), | ||
Contains("new-tag").Contains("first commit"), | ||
). | ||
Press(keys.Commits.CreateTag). | ||
Tap(func() { | ||
t.ExpectPopup().CommitMessagePanel(). | ||
Title(Equals("Tag name")). | ||
Type("new-tag"). | ||
SwitchToDescription(). | ||
Title(Equals("Tag description")). | ||
Type("message"). | ||
SwitchToSummary(). | ||
Confirm() | ||
}). | ||
Tap(func() { | ||
t.ExpectPopup().Confirmation(). | ||
Title(Equals("Force Tag")). | ||
Content(Contains("The tag 'new-tag' exists already. Press <esc> to cancel, or <enter> to overwrite.")). | ||
Confirm() | ||
}). | ||
Lines( | ||
Contains("new-tag").Contains("second commit"), | ||
DoesNotContain("new-tag").Contains("first commit"), | ||
) | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package tag | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
var ForceTagLightweight = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Overwrite a lightweight tag that already exists", | ||
ExtraCmdArgs: []string{}, | ||
Skip: false, | ||
SetupConfig: func(config *config.AppConfig) {}, | ||
SetupRepo: func(shell *Shell) { | ||
shell.EmptyCommit("first commit") | ||
shell.CreateLightweightTag("new-tag", "HEAD") | ||
shell.EmptyCommit("second commit") | ||
}, | ||
Run: func(t *TestDriver, keys config.KeybindingConfig) { | ||
t.Views().Commits(). | ||
Focus(). | ||
Lines( | ||
Contains("second commit").IsSelected(), | ||
Contains("new-tag").Contains("first commit"), | ||
). | ||
Press(keys.Commits.CreateTag). | ||
Tap(func() { | ||
t.ExpectPopup().CommitMessagePanel(). | ||
Title(Equals("Tag name")). | ||
Type("new-tag"). | ||
Confirm() | ||
}). | ||
Tap(func() { | ||
t.ExpectPopup().Confirmation(). | ||
Title(Equals("Force Tag")). | ||
Content(Contains("The tag 'new-tag' exists already. Press <esc> to cancel, or <enter> to overwrite.")). | ||
Confirm() | ||
}). | ||
Lines( | ||
Contains("new-tag").Contains("second commit"), | ||
DoesNotContain("new-tag").Contains("first commit"), | ||
) | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters