Skip to content

Commit bca20a0

Browse files
committed
fix: update test expectations to use underscores in profile IDs
1 parent ee7fccd commit bca20a0

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

pkg/workingset/create_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,13 @@ func TestCreateOutputFormatJSON(t *testing.T) {
360360
require.NoError(t, err, "Output should be valid JSON")
361361

362362
// Verify the ID field exists and has the expected value
363-
assert.Equal(t, "test-set", result["id"])
363+
assert.Equal(t, "test_set", result["id"])
364364
assert.Len(t, result, 1, "JSON output should only contain the id field")
365365

366366
// Verify the profile was created in the database
367-
dbSet, err := dao.GetWorkingSet(ctx, "test-set")
367+
dbSet, err := dao.GetWorkingSet(ctx, "test_set")
368368
require.NoError(t, err)
369-
assert.Equal(t, "test-set", dbSet.ID)
369+
assert.Equal(t, "test_set", dbSet.ID)
370370
}
371371

372372
// TestCreateOutputFormatHuman tests that human-readable format outputs the expected message
@@ -384,12 +384,12 @@ func TestCreateOutputFormatHuman(t *testing.T) {
384384
})
385385

386386
// Verify human-readable output
387-
assert.Contains(t, output, "Created profile test-set with 2 servers")
387+
assert.Contains(t, output, "Created profile test_set with 2 servers")
388388

389389
// Verify the profile was created in the database
390-
dbSet, err := dao.GetWorkingSet(ctx, "test-set")
390+
dbSet, err := dao.GetWorkingSet(ctx, "test_set")
391391
require.NoError(t, err)
392-
assert.Equal(t, "test-set", dbSet.ID)
392+
assert.Equal(t, "test_set", dbSet.ID)
393393
assert.Len(t, dbSet.Servers, 2)
394394
}
395395

@@ -422,7 +422,7 @@ func TestCreateJSONWithDuplicateIDPrevention(t *testing.T) {
422422
var result2 map[string]string
423423
err = json.Unmarshal([]byte(output2), &result2)
424424
require.NoError(t, err)
425-
assert.Equal(t, "test-2", result2["id"], "Second profile should have -2 suffix")
425+
assert.Equal(t, "test_2", result2["id"], "Second profile should have _2 suffix")
426426

427427
// Create third profile with the same name
428428
output3 := captureStdout(func() {
@@ -435,7 +435,7 @@ func TestCreateJSONWithDuplicateIDPrevention(t *testing.T) {
435435
var result3 map[string]string
436436
err = json.Unmarshal([]byte(output3), &result3)
437437
require.NoError(t, err)
438-
assert.Equal(t, "test-3", result3["id"], "Third profile should have -3 suffix")
438+
assert.Equal(t, "test_3", result3["id"], "Third profile should have _3 suffix")
439439
}
440440

441441
// TestCreateDefaultOutputFormat tests that the default format is human-readable
@@ -471,12 +471,12 @@ func TestCreateJSONWithNoServers(t *testing.T) {
471471
var result map[string]string
472472
err := json.Unmarshal([]byte(output), &result)
473473
require.NoError(t, err)
474-
assert.Equal(t, "empty-set", result["id"])
474+
assert.Equal(t, "empty_set", result["id"])
475475

476476
// Verify the profile was created in the database with no servers
477-
dbSet, err := dao.GetWorkingSet(ctx, "empty-set")
477+
dbSet, err := dao.GetWorkingSet(ctx, "empty_set")
478478
require.NoError(t, err)
479-
assert.Equal(t, "empty-set", dbSet.ID)
479+
assert.Equal(t, "empty_set", dbSet.ID)
480480
assert.Empty(t, dbSet.Servers)
481481
}
482482

@@ -494,12 +494,12 @@ func TestCreateOutputFormatYAML(t *testing.T) {
494494
})
495495

496496
// Verify YAML format
497-
assert.Equal(t, "id: test-set\n", output)
497+
assert.Equal(t, "id: test_set\n", output)
498498

499499
// Verify the profile was created in the database
500-
dbSet, err := dao.GetWorkingSet(ctx, "test-set")
500+
dbSet, err := dao.GetWorkingSet(ctx, "test_set")
501501
require.NoError(t, err)
502-
assert.Equal(t, "test-set", dbSet.ID)
502+
assert.Equal(t, "test_set", dbSet.ID)
503503
}
504504

505505
// TestCreateUnsupportedFormat tests that unsupported formats are rejected

0 commit comments

Comments
 (0)