Fixed some small paper-cuts

- Fixed a bug that was pushing duplicate view entries to the backstack
- The appended column will now be selected once added
This commit is contained in:
Leon Mika 2022-10-16 09:50:27 +11:00
parent b51c13dfb1
commit bfd0943c4f
14 changed files with 155 additions and 46 deletions

View file

@ -0,0 +1,35 @@
package testworkspace
import (
"github.com/lmika/audax/internal/common/workspaces"
"github.com/stretchr/testify/assert"
"os"
"testing"
)
func New(t *testing.T) *workspaces.Workspace {
wsTempFile := tempFile(t)
wsManager := workspaces.New(workspaces.MetaInfo{Command: "dynamo-browse"})
ws, err := wsManager.Open(wsTempFile)
if err != nil {
t.Fatalf("cannot create workspace manager: %v", err)
}
t.Cleanup(func() { ws.Close() })
return ws
}
func tempFile(t *testing.T) string {
t.Helper()
tempFile, err := os.CreateTemp("", "export.csv")
assert.NoError(t, err)
tempFile.Close()
t.Cleanup(func() {
os.Remove(tempFile.Name())
})
return tempFile.Name()
}