Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset object in state when editing submitted item #319

Merged
merged 2 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cypress/integration/app.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ describe("Basic e2e", function () {
cy.get("button[type=submit]").contains("Submit").click()
cy.get(".MuiListItem-container", { timeout: 10000 }).should("have.length", 1)

// Clear form
cy.get("button[type=button]").contains("Clear").click()

// Edit saved submission
cy.get("button[type=button]").contains("Edit").click()
cy.get("input[name='descriptor.studyTitle']").should("have.value", "New title")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const WizardSavedObjectActions = (props: WizardSavedObjectActionsProps): React$E
const response = await objectAPIService.getObjectByAccessionId(props.objectType, props.objectId)

if (response.ok) {
dispatch(resetCurrentObject())
dispatch(
setCurrentObject({
...response.data,
Expand Down