|
| 1 | +package file |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/jesseduffield/lazygit/pkg/config" |
| 5 | + . "github.com/jesseduffield/lazygit/pkg/integration/components" |
| 6 | +) |
| 7 | + |
| 8 | +var RenamedFiles = NewIntegrationTest(NewIntegrationTestArgs{ |
| 9 | + Description: "Regression test for the display of renamed files in the file tree", |
| 10 | + ExtraCmdArgs: []string{}, |
| 11 | + Skip: false, |
| 12 | + SetupConfig: func(config *config.AppConfig) { |
| 13 | + }, |
| 14 | + SetupRepo: func(shell *Shell) { |
| 15 | + shell.CreateDir("dir") |
| 16 | + shell.CreateDir("dir/nested") |
| 17 | + shell.CreateFileAndAdd("file1", "file1 content\n") |
| 18 | + shell.CreateFileAndAdd("dir/file2", "file2 content\n") |
| 19 | + shell.CreateFileAndAdd("dir/nested/file3", "file3 content\n") |
| 20 | + shell.Commit("initial commit") |
| 21 | + shell.RunCommand([]string{"git", "mv", "file1", "dir/file1"}) |
| 22 | + shell.RunCommand([]string{"git", "mv", "dir/file2", "dir/file2-renamed"}) |
| 23 | + shell.RunCommand([]string{"git", "mv", "dir/nested/file3", "file3"}) |
| 24 | + }, |
| 25 | + Run: func(t *TestDriver, keys config.KeybindingConfig) { |
| 26 | + t.Views().Files(). |
| 27 | + IsFocused(). |
| 28 | + Lines( |
| 29 | + Equals("▼ /"), |
| 30 | + Equals(" ▼ dir"), |
| 31 | + Equals(" R file1 → file1"), |
| 32 | + Equals(" R dir/file2 → file2-renamed"), // don't want the 'dir/' prefix here |
| 33 | + Equals(" R dir/nested/file3 → file3"), |
| 34 | + ) |
| 35 | + }, |
| 36 | +}) |
0 commit comments