Skip to content

Commit be82736

Browse files
committed
wip
1 parent e18ec08 commit be82736

File tree

7 files changed

+17
-12
lines changed

7 files changed

+17
-12
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/charmbracelet/lipgloss v1.1.0
1111
github.com/charmbracelet/x/exp/teatest v0.0.0-20250711012602-b1f986320f7e
1212
github.com/expr-lang/expr v1.17.5
13-
github.com/flowexec/tuikit v0.2.2
13+
github.com/flowexec/tuikit v0.2.3
1414
github.com/flowexec/vault v0.1.2
1515
github.com/gen2brain/beeep v0.11.1
1616
github.com/jahvon/glamour v0.8.1-patch3

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ github.com/esiqveland/notify v0.13.3 h1:QCMw6o1n+6rl+oLUfg8P1IIDSFsDEb2WlXvVvIJb
7979
github.com/esiqveland/notify v0.13.3/go.mod h1:hesw/IRYTO0x99u1JPweAl4+5mwXJibQVUcP0Iu5ORE=
8080
github.com/expr-lang/expr v1.17.5 h1:i1WrMvcdLF249nSNlpQZN1S6NXuW9WaOfF5tPi3aw3k=
8181
github.com/expr-lang/expr v1.17.5/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4=
82-
github.com/flowexec/tuikit v0.2.2 h1:3zPM2cWr2D+vjSU+d0NBRjhBlIpb6+ms479LMYg2SLg=
83-
github.com/flowexec/tuikit v0.2.2/go.mod h1:fjMwEM7FkxbP7bIV4CfEjsixgjicgQqPrejoBZAHf5s=
82+
github.com/flowexec/tuikit v0.2.3 h1:hGlBc8yXvj4AXaKFp+IUNQ9nO7xOYY4W99m1BfNT13Q=
83+
github.com/flowexec/tuikit v0.2.3/go.mod h1:fjMwEM7FkxbP7bIV4CfEjsixgjicgQqPrejoBZAHf5s=
8484
github.com/flowexec/vault v0.1.2 h1:INQ/w81piKRM+zqPBQpxFYl1iK8dI3APIHZ1F1Jm7CA=
8585
github.com/flowexec/vault v0.1.2/go.mod h1:nxoGHIVjwSgg1o6DoTmj5NCJtubu71SvS883LPUXuvg=
8686
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=

tests/browse_cmds_e2e_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package tests_test
44

55
import (
66
stdCtx "context"
7+
"fmt"
78
stdIO "io"
89
"path/filepath"
910
"time"
@@ -48,7 +49,7 @@ var _ = Describe("browse TUI", func() {
4849

4950
Specify("narrow snapshot", func() {
5051
tm := teatest.NewTestModel(GinkgoTB(), container, teatest.WithInitialTermSize(80, 25))
51-
// container.Program().SetTeaProgram(tm.GetProgram())
52+
container.Program().SetTeaProgram(tm.GetProgram())
5253
container.SetSendFunc(tm.Send)
5354

5455
wsList, err := ctx.WorkspacesCache.GetWorkspaceConfigList(ctx.Logger)
@@ -75,6 +76,7 @@ var _ = Describe("browse TUI", func() {
7576

7677
Specify("wide snapshot", func() {
7778
tm := teatest.NewTestModel(GinkgoTB(), container, teatest.WithInitialTermSize(150, 25))
79+
container.Program().SetTeaProgram(tm.GetProgram())
7880
container.SetSendFunc(tm.Send)
7981

8082
wsList, err := ctx.WorkspacesCache.GetWorkspaceConfigList(ctx.Logger)
@@ -101,7 +103,9 @@ var _ = Describe("browse TUI", func() {
101103

102104
Specify("list snapshot", func() {
103105
tm := teatest.NewTestModel(GinkgoTB(), container, teatest.WithInitialTermSize(80, 25))
106+
container.Program().SetTeaProgram(tm.GetProgram())
104107
container.SetSendFunc(tm.Send)
108+
fmt.Println("Running executable list snapshot test...")
105109

106110
execList, err := ctx.ExecutableCache.GetExecutableList(ctx.Logger)
107111
Expect(err).NotTo(HaveOccurred())
@@ -127,6 +131,7 @@ var _ = Describe("browse TUI", func() {
127131
exec.SetContext("default", ctx.WorkspaceDir(), "", path)
128132

129133
tm := teatest.NewTestModel(GinkgoTB(), container, teatest.WithInitialTermSize(80, 25))
134+
container.Program().SetTeaProgram(tm.GetProgram())
130135
container.SetSendFunc(tm.Send)
131136

132137
execView := execIO.NewExecutableView(ctx.Context, exec, runFunc)

tests/testdata/browse TUI exec snapshot.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
 │ echo 'Hello, world! This is a snapshot test.'
1111

1212
 Executable can be found in
13-
 /TMPDIR/defaul
13+
 /TMPDIR/browse _tui35189330/default/
1414
 flow
1515
 [ 🔗
16-
 /TMPDIR/defaul
16+
 /TMPDIR/browse _tui35189330/default/
1717
 flow
1818
 ]
1919

tests/testdata/browse TUI narrow snapshot.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222

2323
────────────────────────────────────────────────────────────────────────────────
2424
[ q/ctrl+c: quit] [ h: help ] ● Default Workspace ->
25-
/TMPDIR/default[?2004l[?25h[?1002l[?1003l[?1006l
25+
/TMPDIR/browse _tui1729679775/default [?2004l[?25h[?1002l[?1003l[?1006l

tests/testdata/browse TUI wide snapshot.golden

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
▌  │ echo 'hello from nameless'
2424
2525
▌  Executable can be found in
26-
▌  /TMPDIR/
26+
▌  /TMPDIR/browse _tui604194612/
2727
▌  flow
2828
▌  [ 🔗
29-
▌  /TMPDIR/
29+
▌  /TMPDIR/browse _tui604194612/
3030
▌  flow
3131
▌  ]
3232
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
33-
[ q/ctrl+c: quit] [ h: help ] ● Default Workspace -> /TMPDIR/default[?2004l[?25h[?1002l[?1003l[?1006l
33+
[ q/ctrl+c: quit] [ h: help ] ● Default Workspace -> /TMPDIR/browse _tui604194612/default [?2004l[?25h[?1002l[?1003l[?1006l

tests/utils/golden.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ func NormalizeTmpDirs(input string) string {
3737
}
3838
tmpDirPattern := regexp.QuoteMeta(tmpDir)
3939
// Match temp dir followed by any path plus any trailing whitespace
40-
re := regexp.MustCompile(tmpDirPattern + `[^\s\x00-\x1F]+\s*`)
40+
re := regexp.MustCompile(tmpDirPattern + `[^\s\x00-\x1F]+`)
4141
result := re.ReplaceAllStringFunc(input, func(m string) string {
4242
pathAfterTmp := m[len(tmpDir):]
4343
// Trim whitespace from the captured path
44-
pathAfterTmp = strings.TrimSpace(pathAfterTmp)
44+
// pathAfterTmp = strings.TrimSpace(pathAfterTmp)
4545
parts := strings.Split(pathAfterTmp, "/")
4646
if len(parts) >= 2 {
4747
// Keep only the last meaningful part

0 commit comments

Comments
 (0)