File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 31
31
*/
32
32
class ProductSearchTest extends GraphQlAbstract
33
33
{
34
+ /**
35
+ * Verify that filters for non-existing category are empty
36
+ *
37
+ * @throws \Exception
38
+ */
39
+ public function testFilterForNonExistingCategory ()
40
+ {
41
+ $ query = <<<QUERY
42
+ {
43
+ products(filter: {category_id: {eq: "99999999"}}) {
44
+ filters {
45
+ name
46
+ }
47
+ }
48
+ }
49
+ QUERY ;
50
+
51
+ $ response = $ this ->graphQlQuery ($ query );
52
+
53
+ $ this ->assertArrayHasKey (
54
+ 'filters ' ,
55
+ $ response ['products ' ],
56
+ 'Filters are missing in product query result. '
57
+ );
58
+
59
+ $ this ->assertEmpty (
60
+ $ response ['products ' ]['filters ' ],
61
+ 'Returned filters data set does not empty '
62
+ );
63
+ }
64
+
34
65
/**
35
66
* Verify that layered navigation filters and aggregations are correct for product query
36
67
*
You can’t perform that action at this time.
0 commit comments