8000 #97 $().filter("") returns empty set · seleniumQuery/seleniumQuery@de675bd · GitHub
[go: up one dir, main page]

Skip to content

Commit de675bd

Browse files
committed
#97 $().filter("") returns empty set
1 parent ec69cda commit de675bd

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/test/java/io/github/seleniumquery/functions/jquery/traversing/filtering/filterfunction/FilterPredicateFunctionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class FilterPredicateFunctionTest {
3535
FilterPredicateFunction filterPredicateFunction = new FilterPredicateFunction();
3636

3737
@Test
38-
public void null_predicate__should_return_EMPTY_elements() {
38+
public void null_predicate__should_return_EMPTY_element_set() {
3939
// given
4040
SeleniumQueryObject targetSQO = createStubSeleniumQueryObjectWithAtLeastOneElement();
4141
// when

src/test/java/io/github/seleniumquery/functions/jquery/traversing/filtering/filterfunction/FilterSelectorFunctionTest.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,16 @@ public void null_selector__should_return_EMPTY_element_set() {
2323
assertThat(resultSQO.get(), empty());
2424
}
2525

26-
// TODO filter(this, null) --> should return empty
27-
// TODO filter(this, "") --> should return empty
26+
@Test
27+
public void emptyString_selector__should_return_EMPTY_element_set() {
28+
// given
29+
SeleniumQueryObject targetSQO = createStubSeleniumQueryObjectWithAtLeastOneElement();
30+
// when
31+
SeleniumQueryObject resultSQO = filterSelectorFunction.filter(targetSQO, "");
32+
// then
33+
assertThat(resultSQO.get(), empty());
34+
}
35+
2836
// TODO filter(this, "selector") --> should keep everyone that matches the isFunction("selector")
2937

3038
}

0 commit comments

Comments
 (0)
0