@@ -2,6 +2,7 @@ package list
22
33import (
44 "context"
5+ "github.com/stackitcloud/stackit-cli/internal/pkg/utils"
56 "strconv"
67 "testing"
78
@@ -19,11 +20,14 @@ import (
1920type testCtxKey struct {}
2021
2122var (
22- testCtx = context .WithValue (context .Background (), testCtxKey {}, "foo" )
23- testClient = & alb.APIClient {}
24- testProjectId = uuid .NewString ()
25- testRegion = "eu01"
26- testLimit int64 = 10
23+ testCtx = context .WithValue (context .Background (), testCtxKey {}, "foo" )
24+ testClient = & alb.APIClient {}
25+ testProjectId = uuid .NewString ()
26+ )
27+
28+ const (
29+ testRegion = "eu01"
30+ testLimit int64 = 10
2731)
2832
2933func fixtureFlagValues (mods ... func (flagValues map [string ]string )) map [string ]string {
@@ -41,7 +45,7 @@ func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]st
4145func fixtureInputModel (mods ... func (model * inputModel )) * inputModel {
4246 model := & inputModel {
4347 GlobalFlagModel : & globalflags.GlobalFlagModel {ProjectId : testProjectId , Region : testRegion , Verbosity : globalflags .VerbosityDefault },
44- Limit : & testLimit ,
48+ Limit : utils . Ptr ( testLimit ) ,
4549 }
4650 for _ , mod := range mods {
4751 mod (model )
@@ -136,6 +140,7 @@ func TestBuildRequest(t *testing.T) {
136140func Test_outputResult (t * testing.T ) {
137141 type args struct {
138142 outputFormat string
143+ projectLabel string
139144 items []alb.LoadBalancer
140145 }
141146 tests := []struct {
@@ -164,7 +169,7 @@ func Test_outputResult(t *testing.T) {
164169 p .Cmd = NewCmd (& params.CmdParams {Printer : p })
165170 for _ , tt := range tests {
166171 t .Run (tt .name , func (t * testing.T ) {
167- if err := outputResult (p , tt .args .outputFormat , tt .args .items ); (err != nil ) != tt .wantErr {
172+ if err := outputResult (p , tt .args .outputFormat , tt .args .projectLabel , tt . args . items ); (err != nil ) != tt .wantErr {
168173 t .Errorf ("outputResult() error = %v, wantErr %v" , err , tt .wantErr )
169174 }
170175 })
0 commit comments