@@ -44,39 +44,34 @@ func TestStackDeploymentGroupsList(t *testing.T) {
44
44
stackUpdated .LatestStackConfiguration , _ = client .StackConfigurations .Read (ctx , stackUpdated .LatestStackConfiguration .ID )
45
45
46
46
t .Run ("with valid stack configuration ID" , func (t * testing.T ) {
47
- //t.Parallel()
48
47
sdgl , err := client .StackDeploymentGroups .List (ctx , stackUpdated .LatestStackConfiguration .ID , nil )
49
48
require .NoError (t , err )
50
49
require .NotNil (t , sdgl )
51
-
52
50
for _ , item := range sdgl .Items {
53
- assert .NotNil (t , item .Id )
51
+ assert .NotNil (t , item .ID )
54
52
assert .NotEmpty (t , item .Name )
55
53
assert .NotEmpty (t , item .Status )
56
54
assert .NotNil (t , item .CreatedAt )
57
55
assert .NotNil (t , item .UpdatedAt )
58
- assert .NotEmpty (t , item .StackConfigurationId )
59
- assert .GreaterOrEqual (t , item .FailureCount , 0 )
60
56
}
57
+ require .Len (t , sdgl .Items , 2 )
61
58
})
62
59
63
- // t.Run("with invalid stack configuration ID", func(t *testing.T) {
64
- // //t.Parallel()
65
- // _, err := client.StackDeploymentGroups.List(ctx, "", nil)
66
- // require.Error(t, err)
67
- // })
60
+ t .Run ("with invalid stack configuration ID" , func (t * testing.T ) {
61
+ _ , err := client .StackDeploymentGroups .List (ctx , "" , nil )
62
+ require .Error (t , err )
63
+ })
68
64
69
- // t.Run("List with pagination", func(t *testing.T) {
70
- // t.Parallel()
71
- // options := &StackDeploymentGroupListOptions{
72
- // ListOptions: ListOptions{
73
- // PageNumber: 2,
74
- // PageSize: 2,
75
- // },
76
- // }
77
- // sdgl, err := client.StackDeploymentGroups.List(ctx, stackUpdated.LatestStackConfiguration.ID, options)
78
- // require.NoError(t, err)
79
- // require.NotNil(t, sdgl)
80
- // require.Len(t, sdgl.Items, 0)
81
- // })
65
+ t .Run ("List with pagination" , func (t * testing.T ) {
66
+ options := & StackDeploymentGroupListOptions {
67
+ ListOptions : ListOptions {
68
+ PageNumber : 1 ,
69
+ PageSize : 1 ,
70
+ },
71
+ }
72
+ sdgl , err := client .StackDeploymentGroups .List (ctx , stackUpdated .LatestStackConfiguration .ID , options )
73
+ require .NoError (t , err )
74
+ require .NotNil (t , sdgl )
75
+ require .Len (t , sdgl .Items , 1 )
76
+ })
82
77
}
0 commit comments