diff --git a/test/helpers/scaled_snapshots_test.go b/test/helpers/scaled_snapshots_test.go index 4f87f2b06a6..7e5b57668ec 100644 --- a/test/helpers/scaled_snapshots_test.go +++ b/test/helpers/scaled_snapshots_test.go @@ -3,7 +3,10 @@ package helpers_test import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + v1 "github.com/solo-io/gloo/projects/gloo/pkg/api/v1" + "github.com/solo-io/gloo/projects/gloo/pkg/api/v1/gloosnapshot" "github.com/solo-io/gloo/test/helpers" + "github.com/solo-io/solo-kit/pkg/api/v1/resources/core" ) var _ = Describe("ScaledSnapshotBuilder", func() { @@ -53,4 +56,21 @@ var _ = Describe("ScaledSnapshotBuilder", func() { }) }) }) + + When("with injected snapshot", func() { + It("returns the injected snapshot regardless of other settings", func() { + inSnap := &gloosnapshot.ApiSnapshot{ + Upstreams: []*v1.Upstream{ + { + Metadata: &core.Metadata{ + Name: "injected-name", + Namespace: "injected-namespace", + }, + }, + }, + } + outSnap := helpers.NewScaledSnapshotBuilder().WithInjectedSnapshot(inSnap).WithUpstreamCount(10).Build() + Expect(outSnap).To(Equal(inSnap)) + }) + }) })