Skip to content

Commit

Permalink
[e2e] Ensure the latest version is selected before submitting (#1827)
Browse files Browse the repository at this point in the history
* Only request chartVersion if not populated

Co-authored-by: absoludity <absoludity@gmail.com>
  • Loading branch information
Andres Martinez Gotor and absoludity committed Jul 2, 2020
1 parent 2bfcb3a commit 0be157d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ class DeploymentFormBody extends React.Component<
};

public componentDidMount() {
const { chartID, chartNamespace, getChartVersion, chartVersion } = this.props;
getChartVersion(chartNamespace, chartID, chartVersion);
const { chartID, chartNamespace, getChartVersion, chartVersion, selected } = this.props;
const { version } = selected;
if (!version || version.id !== chartID) {
// The chart version may have been already populated from the ChartView
getChartVersion(chartNamespace, chartID, chartVersion);
}
}

public componentDidUpdate = (prevProps: IDeploymentFormBodyProps) => {
Expand Down
4 changes: 4 additions & 0 deletions integration/use-cases/create-private-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ test("Creates a private registry", async () => {

await expect(page).toSelect("#chartVersion", "7.3.16");

await expect(page).toClick("li", { text: "Changes" });

await expect(page).toMatch("tag: 2.4.43-debian-10-r54");

await expect(page).toClick(".button-primary");

await expect(page).toMatch("Up to date", { timeout: 60000 });
Expand Down

0 comments on commit 0be157d

Please sign in to comment.