mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-05 04:27:09 +00:00
replay ui fix (#56)
* refactor: rename inspect to replay across the codebase Renames inspect-ui/ to replay-ui/, internal/inspect/ to internal/replay/, the CLI subcommand from `sanderling inspect` to `sanderling replay`, and updates all references in docs, Makefile, README, and Go comments. * feat(replay-ui): show spec filename with full path on hover RunList and RunDetail now render the basename of spec_path (e.g. login.spec.ts) with the full path available as a title tooltip.
This commit is contained in:
71 files changed
+104
-92
No files matched your search
@@ -0,0 +1,45 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestParseReplayArgs_Defaults(t *testing.T) {
|
||||
options, err := parseReplayArgs(nil, io.Discard)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if options.port != 0 || options.noOpen || options.dev || options.directory != "" {
|
||||
t.Errorf("unexpected defaults: %+v", options)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseReplayArgs_AllFlags(t *testing.T) {
|
||||
options, err := parseReplayArgs([]string{"--port", "9090", "--no-open", "--dev", "/tmp/runs"}, io.Discard)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if options.port != 9090 || !options.noOpen || !options.dev || options.directory != "/tmp/runs" {
|
||||
t.Errorf("unexpected options: %+v", options)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseReplayArgs_RejectsTooManyPositional(t *testing.T) {
|
||||
_, err := parseReplayArgs([]string{"a", "b"}, io.Discard)
|
||||
if err == nil || !strings.Contains(err.Error(), "at most one") {
|
||||
t.Fatalf("expected too-many-args error, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRun_HelpListsReplayCommand(t *testing.T) {
|
||||
var stdout bytes.Buffer
|
||||
if err := run([]string{"sanderling"}, &stdout, io.Discard); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !strings.Contains(stdout.String(), "replay") {
|
||||
t.Errorf("usage missing replay command: %q", stdout.String())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user