From 597e55940cf274de0a646c5ac416b3154deccacc Mon Sep 17 00:00:00 2001 From: Andres Martinez Gotor Date: Mon, 13 Jan 2020 17:51:42 +0100 Subject: [PATCH] Use default chart values for rendering the Changes tab when upgrading --- dashboard/src/components/UpgradeForm/UpgradeForm.test.tsx | 7 +++++++ dashboard/src/components/UpgradeForm/UpgradeForm.tsx | 5 ++++- .../UpgradeForm/__snapshots__/UpgradeForm.test.tsx.snap | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dashboard/src/components/UpgradeForm/UpgradeForm.test.tsx b/dashboard/src/components/UpgradeForm/UpgradeForm.test.tsx index 543d921e2d7..f5749d7b9f6 100644 --- a/dashboard/src/components/UpgradeForm/UpgradeForm.test.tsx +++ b/dashboard/src/components/UpgradeForm/UpgradeForm.test.tsx @@ -236,3 +236,10 @@ describe("when receiving new props", () => { }); }); }); + +it("shows, by default, the default values of the deployed chart plus any modification", () => { + const wrapper = shallow(); + wrapper.setProps({ deployed: { values: "# A comment\nfoo: bar\n" } as IChartState["deployed"] }); + const expectedValues = "# A comment\nfoo: not-bar\n"; + expect(wrapper.find(DeploymentFormBody).prop("deployedValues")).toBe(expectedValues); +}); diff --git a/dashboard/src/components/UpgradeForm/UpgradeForm.tsx b/dashboard/src/components/UpgradeForm/UpgradeForm.tsx index d21eb257d0d..f5b99e23fbf 100644 --- a/dashboard/src/components/UpgradeForm/UpgradeForm.tsx +++ b/dashboard/src/components/UpgradeForm/UpgradeForm.tsx @@ -93,7 +93,10 @@ class UpgradeForm extends React.Component