Skip to content

Commit

Permalink
test(api): add test theme not found
Browse files Browse the repository at this point in the history
  • Loading branch information
acouvreur committed Feb 2, 2025
1 parent 0eb92ed commit 357a7a7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/api/start_dynamic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ func TestStartDynamic(t *testing.T) {
assert.Equal(t, http.StatusBadRequest, r.Code)
assert.Equal(t, rfc7807.JSONMediaType, r.Header().Get("Content-Type"))
})
t.Run("StartDynamicThemeNotFound", func(t *testing.T) {
app, router, strategy, m := NewApiTest(t)
StartDynamic(router, strategy)
m.EXPECT().RequestSessionGroup("test", gomock.Any()).Return(&sessions.SessionState{}, nil)
r := PerformRequest(app, "GET", "/api/strategies/dynamic?group=test&theme=invalid")
assert.Equal(t, http.StatusNotFound, r.Code)
assert.Equal(t, rfc7807.JSONMediaType, r.Header().Get("Content-Type"))
})
t.Run("StartDynamicByNames", func(t *testing.T) {
app, router, strategy, m := NewApiTest(t)
StartDynamic(router, strategy)
Expand Down

0 comments on commit 357a7a7

Please sign in to comment.