Skip to content

Commit f641a98

Browse files
committed
MC-18009: Disabled Products Do Not Appear in Search Results of Link Attribute
- update tests
1 parent fa4844d commit f641a98

File tree

1 file changed

+6
-3
lines changed
  • dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product

1 file changed

+6
-3
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/SearchTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public function testExecuteNonExistingSearchKey() : void
3838
->setPostValue('limit', 50);
3939
$this->dispatch('backend/catalog/product/search');
4040
$responseBody = $this->getResponse()->getBody();
41-
$this->assertContains('{"options":[],"total":0}', $responseBody);
41+
$jsonResponse = json_decode($responseBody);
42+
$this->assertEmpty($jsonResponse['options']);
4243
}
4344

4445
/**
@@ -57,7 +58,8 @@ public function testExecuteNotVisibleIndividuallyProducts() : void
5758
->setPostValue('limit', 50);
5859
$this->dispatch('backend/catalog/product/search');
5960
$responseBody = $this->getResponse()->getBody();
60-
$this->assertContains('"total":1}', $responseBody);
61+
$jsonResponse = json_decode($responseBody);
62+
$this->assertEquals(1, $jsonResponse['total']);
6163
}
6264

6365
/**
@@ -71,6 +73,7 @@ public function testExecuteEnabledAndDisabledProducts() : void
7173
->setPostValue('limit', 50);
7274
$this->dispatch('backend/catalog/product/search');
7375
$responseBody = $this->getResponse()->getBody();
74-
$this->assertContains('"total":3}', $responseBody);
76+
$jsonResponse = json_decode($responseBody);
77+
$this->assertEquals(7, $jsonResponse['total']);
7578
}
7679
}

0 commit comments

Comments
 (0)