Skip to content

Commit f448409

Browse files
committed
test(functions): add ut for $().text()
1 parent 27b37ef commit f448409

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package io.github.seleniumquery.functions.jquery.manipulation;
2+
3+
import static java.util.Arrays.asList;
4+
import static org.junit.Assert.assertEquals;
5+
6+
import java.util.List;
7+
8+
import org.junit.Test;
9+
import org.openqa.selenium.WebElement;
10+
11+
import testinfrastructure.testdouble.org.openqa.selenium.WebElementStub;
12+
13+
public class TextFunctionTest {
14+
15+
private static class WebElementText extends WebElementStub {
16+
private final String text;
17+
private WebElementText(String text) {
18+
this.text = text;
19+
}
20+
@Override
21+
public String getText() {
22+
return this.text;
23+
}
24+
}
25+
26+
@Test
27+
public void text() {
28+
// given
29+
List<WebElement> els = asList(new WebElementText("AAA"), new WebElementText("BBB"), new WebElementText("CCC"));
30+
// when
31+
String text = TextFunction.text(els);
32+
// then
33+
assertEquals("AAA BBB CCC", text);
34+
}
35+
36+
}

0 commit comments

Comments
 (0)