feat(catalog): omit hidden products before pagination
This commit is contained in:
@@ -62,6 +62,8 @@ class CatalogSearchTest extends TestCase
|
||||
$this->createCatalogItem($tenant, "Running {$number}");
|
||||
}
|
||||
$exactMatch = $this->createCatalogItem($tenant, 'Running');
|
||||
$outOfStockMatch = $this->createCatalogItem($tenant, 'Running unavailable');
|
||||
$outOfStockMatch->inventory->update(['real_stock' => 0]);
|
||||
$this->createCatalogItem($tenant, 'Unrelated');
|
||||
$this->createCatalogItem($otherTenant, 'Running foreign');
|
||||
|
||||
@@ -76,6 +78,7 @@ class CatalogSearchTest extends TestCase
|
||||
->assertJsonPath('meta.total', 6)
|
||||
->assertJsonCount(4, 'data')
|
||||
->assertJsonPath('data.0.id', $exactMatch->id)
|
||||
->assertJsonMissing(['nombre' => 'Running unavailable'])
|
||||
->assertJsonMissing(['nombre' => 'Running foreign'])
|
||||
->assertJsonMissing(['nombre' => 'Unrelated']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user