Skip to content

Commit

Permalink
#14312: Write failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbucknell committed Mar 25, 2018
1 parent fe17868 commit ba19386
Showing 1 changed file with 25 additions and 0 deletions.
Expand Up @@ -520,6 +520,31 @@ public function testQueryCustomAttributeField()
$this->assertCustomAttribute($response['products']['items'][0]);
}

/**
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
*/
public function testFilterProductByNull()
{
if (!$this->cleanCache()) {
$this->fail('Cache could not be cleaned properly.');
}

$query = <<<QUERY
{
products(filter: {special_price: {null: true }})
{
total_count
}
}
QUERY;

$response = $this->graphQlQuery($query);

$this->assertArrayHasKey('products', $response);
$this->assertArrayHasKey('total_count', $response['products']);
$this->assertEquals(1, $response['products']['total_count']);
}

/**
* @param ProductInterface $product
* @param array $actualResponse
Expand Down

0 comments on commit ba19386

Please sign in to comment.