diff --git a/src/common/k8s-api/endpoints/helm-charts.api/request-readme.injectable.ts b/src/common/k8s-api/endpoints/helm-charts.api/request-readme.injectable.ts
index 4314d68578..fb8eaafa10 100644
--- a/src/common/k8s-api/endpoints/helm-charts.api/request-readme.injectable.ts
+++ b/src/common/k8s-api/endpoints/helm-charts.api/request-readme.injectable.ts
@@ -3,12 +3,13 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
+import type { AsyncResult } from "../../../utils/async-result";
import { urlBuilderFor } from "../../../utils/buildUrl";
import apiBaseInjectable from "../../api-base.injectable";
const requestReadmeEndpoint = urlBuilderFor("/v2/charts/:repo/:name/readme");
-export type RequestHelmChartReadme = (repo: string, name: string, version?: string) => Promise;
+export type RequestHelmChartReadme = (repo: string, name: string, version?: string) => Promise>;
const requestHelmChartReadmeInjectable = getInjectable({
id: "request-helm-chart-readme",
diff --git a/src/features/helm-charts/installing-chart/__snapshots__/opening-dock-tab-for-installing-helm-chart.test.ts.snap b/src/features/helm-charts/installing-chart/__snapshots__/opening-dock-tab-for-installing-helm-chart.test.ts.snap
index bdd6779b76..e949e6c3c6 100644
--- a/src/features/helm-charts/installing-chart/__snapshots__/opening-dock-tab-for-installing-helm-chart.test.ts.snap
+++ b/src/features/helm-charts/installing-chart/__snapshots__/opening-dock-tab-for-installing-helm-chart.test.ts.snap
@@ -4631,6 +4631,919 @@ exports[`opening dock tab for installing helm chart given application is started
+
+
+
+
+
+ Chart: some-repository/some-name
+
+
+ content_copy
+
+
+
+ Copy
+
+
+
+
+ close
+
+
+
+ Close
+
+
+
+
+
+
+
+
+
+
+ some-description
+
+
+
+
+ Version
+
+
+
+
+
+
+
+
+ some-other-version
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Maintainers
+
+
+
+ Some Foo<some@foo.com>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/features/helm-charts/installing-chart/installing-helm-chart-from-new-tab.test.ts b/src/features/helm-charts/installing-chart/installing-helm-chart-from-new-tab.test.ts
index 9d6c43790d..6a28ea7284 100644
--- a/src/features/helm-charts/installing-chart/installing-helm-chart-from-new-tab.test.ts
+++ b/src/features/helm-charts/installing-chart/installing-helm-chart-from-new-tab.test.ts
@@ -178,7 +178,10 @@ describe("installing helm chart from new tab", () => {
}),
]);
- await requestHelmChartReadmeMock.resolve("some-readme");
+ await requestHelmChartReadmeMock.resolve({
+ callWasSuccessful: true,
+ response: "some-readme",
+ });
});
it("renders", () => {
@@ -472,7 +475,10 @@ describe("installing helm chart from new tab", () => {
}),
]);
- await requestHelmChartReadmeMock.resolve("some-readme");
+ await requestHelmChartReadmeMock.resolve({
+ callWasSuccessful: true,
+ response: "some-readme",
+ });
});
it("renders", () => {
diff --git a/src/features/helm-charts/installing-chart/opening-dock-tab-for-installing-helm-chart.test.ts b/src/features/helm-charts/installing-chart/opening-dock-tab-for-installing-helm-chart.test.ts
index c41a7f14ad..3fd6a7deb7 100644
--- a/src/features/helm-charts/installing-chart/opening-dock-tab-for-installing-helm-chart.test.ts
+++ b/src/features/helm-charts/installing-chart/opening-dock-tab-for-installing-helm-chart.test.ts
@@ -230,7 +230,10 @@ describe("opening dock tab for installing helm chart", () => {
describe("when readme resolves", () => {
beforeEach(async () => {
- await requestHelmChartReadmeMock.resolve("some-readme");
+ await requestHelmChartReadmeMock.resolve({
+ callWasSuccessful: true,
+ response: "some-readme",
+ });
});
it("renders", () => {
@@ -276,7 +279,10 @@ describe("opening dock tab for installing helm chart", () => {
describe("when readme resolves", () => {
beforeEach(async () => {
- await requestHelmChartReadmeMock.resolve("some-readme");
+ await requestHelmChartReadmeMock.resolve({
+ callWasSuccessful: true,
+ response: "some-readme",
+ });
});
it("renders", () => {
@@ -299,6 +305,19 @@ describe("opening dock tab for installing helm chart", () => {
);
});
});
+
+ describe("when readme rejects", () => {
+ beforeEach(async () => {
+ await requestHelmChartReadmeMock.resolve({
+ callWasSuccessful: false,
+ error: "some-error",
+ });
+ });
+
+ it("renders", () => {
+ expect(rendered.baseElement).toMatchSnapshot();
+ });
+ });
});
describe("when selecting to install the chart", () => {
diff --git a/src/renderer/components/+helm-charts/details/readme-of-selected-helm-chart.injectable.ts b/src/renderer/components/+helm-charts/details/readme-of-selected-helm-chart.injectable.ts
index 839493bed3..8aa61a74da 100644
--- a/src/renderer/components/+helm-charts/details/readme-of-selected-helm-chart.injectable.ts
+++ b/src/renderer/components/+helm-charts/details/readme-of-selected-helm-chart.injectable.ts
@@ -26,11 +26,13 @@ const readmeOfSelectedHelmChartInjectable = getInjectable({
return "";
}
- return await requestHelmChartReadme(
+ const result = await requestHelmChartReadme(
chartVersion.getRepository(),
chartVersion.getName(),
chartVersion.getVersion(),
);
+
+ return result.callWasSuccessful ? result.response : "";
},
valueWhenPending: "",