-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix forms not being deletable #6369
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.odk.collect.forms.instances | ||
|
||
import org.hamcrest.MatcherAssert.assertThat | ||
import org.hamcrest.Matchers.equalTo | ||
import org.junit.Test | ||
|
||
class InstanceTest { | ||
|
||
@Test | ||
fun `canDeleteBeforeSend is true by default`() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have that test
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'd thought about that (I actually wrote that test then deleted it), but I realized we already had a test for finalized forms and felt like adding this unit test was simpler than testing all the possible states that saved forms could be in. |
||
val instance = Instance.Builder().build() | ||
assertThat(instance.canDeleteBeforeSend(), equalTo(true)) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it handled correctly when forms are synced from disk and should be finalized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean if a form has an entity? We don't currently support local entity creation/updates for synced instances. Otherwise, every
Instance
should now be deletable.