feat(catalog): omit hidden products before pagination

This commit is contained in:
2026-08-24 15:15:55 -03:00
parent 2323994f30
commit e27f7bb166
7 changed files with 112 additions and 46 deletions

View File

@@ -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']);
}