diff --git a/pkg/c8y/uiExtension.go b/pkg/c8y/uiExtension.go index 46c5e5de..91766d2e 100644 --- a/pkg/c8y/uiExtension.go +++ b/pkg/c8y/uiExtension.go @@ -177,9 +177,9 @@ func (s *UIExtensionService) CreateExtension(ctx context.Context, application *A } // Upload binary - binaryVersion, resp, err := s.client.ApplicationVersions.CreateVersion(ctx, app.ID, filename, *opt.Version) + binaryVersion, binaryVersionResponse, err := s.client.ApplicationVersions.CreateVersion(ctx, app.ID, filename, *opt.Version) if err != nil { - return nil, resp, err + return nil, binaryVersionResponse, err } if binaryVersion != nil { @@ -197,7 +197,7 @@ func (s *UIExtensionService) CreateExtension(ctx context.Context, application *A } } - return binaryVersion, resp, err + return binaryVersion, binaryVersionResponse, err } func (s *UIExtensionService) SetActive(ctx context.Context, appID string, binaryID string) (*Application, *Response, error) { diff --git a/test/c8y_test/uiExtension_test.go b/test/c8y_test/uiExtension_test.go index fe60198c..3e83f9ad 100644 --- a/test/c8y_test/uiExtension_test.go +++ b/test/c8y_test/uiExtension_test.go @@ -34,7 +34,7 @@ func TestUIExtensionService_CreateExtension(t *testing.T) { app1.ContextPath = app1.Name testingutils.Ok(t, err) - appVersion1, _, err := client.UIExtension.CreateExtension(context.Background(), &app1.Application, file1.Name(), c8y.UpsertOptions{ + appVersion1, resp, err := client.UIExtension.CreateExtension(context.Background(), &app1.Application, file1.Name(), c8y.UpsertOptions{ SkipActivation: false, Version: &c8y.ApplicationVersion{ Version: app1.ManifestFile.Version, @@ -45,6 +45,7 @@ func TestUIExtensionService_CreateExtension(t *testing.T) { client.Application.Delete(context.Background(), appVersion1.Application.ID) }) testingutils.Ok(t, err) + testingutils.Equals(t, "2.4.3", resp.JSON("version").String()) testingutils.Equals(t, "2.4.3", appVersion1.Version) testingutils.Assert(t, len(appVersion1.Tags) == 2, "Tags should be present") testingutils.ContainsString(t, "tag1", appVersion1.Tags)