From a159e76a628cdbb29e4249f656aa7a0a8136c4e6 Mon Sep 17 00:00:00 2001 From: Owen Stephens Date: Fri, 22 Jun 2018 23:16:09 +0100 Subject: [PATCH] Added test for reconstructing mass edits on dates --- .../tests/operations/cell/MassOperationTests.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/main/tests/server/src/com/google/refine/tests/operations/cell/MassOperationTests.java b/main/tests/server/src/com/google/refine/tests/operations/cell/MassOperationTests.java index 2bc659dac..f4fe82a27 100644 --- a/main/tests/server/src/com/google/refine/tests/operations/cell/MassOperationTests.java +++ b/main/tests/server/src/com/google/refine/tests/operations/cell/MassOperationTests.java @@ -68,6 +68,18 @@ public class MassOperationTests extends RefineTest { Assert.assertFalse(editList.get(0).fromError); } + @Test + public void testReconstructEditDate() throws Exception { + editsString = "[{\"from\":[\"2018-10-04T00:00:00Z\"],\"to\":\"newString\",\"type\":\"text\"}]"; + + editList = MassEditOperation.reconstructEdits(ParsingUtilities.evaluateJsonStringToArray(editsString)); + + Assert.assertEquals(editList.get(0).from.get(0), "2018-10-04T00:00:00Z"); + Assert.assertEquals(editList.get(0).to,"newString" ); + Assert.assertFalse(editList.get(0).fromBlank); + Assert.assertFalse(editList.get(0).fromError); + } + @Test public void testReconstructEditEmpty() throws Exception { editsString = "[{\"from\":[\"\"],\"to\":\"newString\",\"type\":\"text\"}]"; @@ -83,6 +95,5 @@ public class MassOperationTests extends RefineTest { } //Not yet testing for mass edit from OR Error - //Not yet testing for mass edit from OR Date }