Add required-flags render CLI coverage
This commit is contained in:
@@ -68,6 +68,38 @@ func TestRenderEndToEndMarkdownOutput(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRenderWorksWithRequiredFlagsOnly(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
input := writeJSONFile(t, dir, "input.json", `{
|
||||
"metadata": {
|
||||
"application": "seriatim",
|
||||
"version": "v-test",
|
||||
"output_schema": "seriatim-minimal"
|
||||
},
|
||||
"segments": [
|
||||
{"id": 1, "start": 1, "end": 2, "speaker": "Eric", "text": "Hello there."}
|
||||
]
|
||||
}`)
|
||||
output := writeJSONFile(t, dir, "output.md", "")
|
||||
|
||||
err := executeRender(
|
||||
"--input-file", input,
|
||||
"--output-file", output,
|
||||
"--format", config.RenderFormatMarkdown,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("render with required flags failed: %v", err)
|
||||
}
|
||||
|
||||
data := readFile(t, output)
|
||||
if !strings.Contains(data, "# Transcript") {
|
||||
t.Fatalf("missing default title:\n%s", data)
|
||||
}
|
||||
if !strings.Contains(data, "[00:00:01–00:00:02] **Eric:** Hello there.") {
|
||||
t.Fatalf("missing rendered segment:\n%s", data)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRenderRejectsUnsupportedFormat(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
input := writeJSONFile(t, dir, "input.json", `{"metadata":{"application":"seriatim","version":"v-test","output_schema":"seriatim-minimal"},"segments":[]}`)
|
||||
|
||||
Reference in New Issue
Block a user