Skip to content

Commit

Permalink
unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
bewebi committed Jun 26, 2023
1 parent 1ab16d4 commit ee5a78d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/helpers/scaled_snapshots_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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))
})
})
})

0 comments on commit ee5a78d

Please sign in to comment.