feat(catalog): add group_order field to catalog items and update related logic
This commit is contained in:
@@ -354,8 +354,10 @@ class CatalogControllerTest extends TestCase
|
||||
]);
|
||||
|
||||
$food = $this->createItem($tenant, 'Hamburger');
|
||||
$food->update(['group_order' => 2]);
|
||||
$food->category()->associate($category)->save();
|
||||
$this->createItem($tenant, 'Parking');
|
||||
$parking = $this->createItem($tenant, 'Parking');
|
||||
$parking->update(['group_order' => 1]);
|
||||
|
||||
$this->getJson("/api/tenants/{$tenant->codigo}/catalog")
|
||||
->assertOk()
|
||||
@@ -364,6 +366,9 @@ class CatalogControllerTest extends TestCase
|
||||
->assertJsonPath('0.items.0.nombre', 'Hamburger')
|
||||
->assertJsonPath('1.title', 'All products')
|
||||
->assertJsonCount(2, '1.items.data')
|
||||
->assertJsonPath('1.items.data.0.nombre', 'Parking')
|
||||
->assertJsonPath('1.items.data.1.nombre', 'Hamburger')
|
||||
->assertJsonMissingPath('1.items.data.0.group_order')
|
||||
->assertJsonPath('1.items.meta.total', 2);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user