fix: correct GetProperty bug, init to use .ax/, add default aliases, split e2e tests, add due date tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
25
src/e2e_init_test.go
Normal file
25
src/e2e_init_test.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestInit(t *testing.T) {
|
||||
t.Run("CreatesDatabase", func(t *testing.T) {
|
||||
env := &testEnv{t: t, dir: t.TempDir(), user: "testuser"}
|
||||
env.mustAx("init")
|
||||
if _, err := os.Stat(filepath.Join(env.dir, ".ax", "ax.db")); err != nil {
|
||||
t.Fatal(".ax/ax.db not created")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("FailsIfAlreadyExists", func(t *testing.T) {
|
||||
env := newTestEnv(t, "testuser")
|
||||
_, err := env.ax("init")
|
||||
if err == nil {
|
||||
t.Fatal("expected error re-initialising existing DB, got none")
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user