package cgeo.geocaching.utils;

import junit.framework.TestCase;

import org.apache.commons.lang3.StringUtils;

import static org.assertj.core.api.Assertions.assertThat;

public class HtmlUtilsTest extends TestCase {

    public static void testExtractText() {
        assertThat(HtmlUtils.extractText(null)).isEqualTo(StringUtils.EMPTY);
        assertThat(HtmlUtils.extractText(StringUtils.EMPTY)).isEqualTo(StringUtils.EMPTY);
        assertThat(HtmlUtils.extractText("   ")).isEqualTo(StringUtils.EMPTY);
        assertThat(HtmlUtils.extractText("<b>bold</b>")).isEqualTo("bold");
    }

    public static void testRemoveExtraParagraph() {
        assertThat(HtmlUtils.removeExtraParagraph("<p></p>")).isEqualTo("");
        assertThat(HtmlUtils.removeExtraParagraph("<p>Test</p>")).isEqualTo("Test");
        assertThat(HtmlUtils.removeExtraParagraph("<p>1</p><p>2</p>")).isEqualTo("<p>1</p><p>2</p>");
    }
}

@@ -673,33 +673,28 @@
 .removeExtra
-Paragraph
+Tags
 (%22%3Cp%3E%3C/p%3E%22))
@@ -701,17 +701,13 @@
 .isE
-qualTo(%22%22
+mpty(
 );%0A 
@@ -741,33 +741,28 @@
 .removeExtra
-Paragraph
+Tags
 (%22%3Cp%3ETest%3C/p
@@ -825,25 +825,20 @@
 oveExtra
-Paragraph
+Tags
 (%22%3Cp%3E1%3C/
@@ -878,20 +878,119 @@
 %3Cp%3E2%3C/p%3E%22);%0A
+        assertThat(HtmlUtils.removeExtraTags(%22%3Cp%3E%3Cspan%3Econtent%3C/span%3E%3C/p%3E%22)).isEqualTo(%22content%22);%0A
     %7D%0A%7D%0A

fix broken compilation